Skip to content

Instantly share code, notes, and snippets.

View neverovski's full-sized avatar

Dmitry Neverovski neverovski

View GitHub Profile
@neverovski
neverovski / .eslintignore
Last active November 27, 2023 20:23
ESLint Configuration for Node.js
# js files
**/*.js
# compiled output
build
**/build
dist
**/dist
@neverovski
neverovski / tsconfig.json
Last active November 27, 2023 19:50
TSConfig for NodeJs
{
"compilerOptions": {
"lib": ["ES2023"],
"module": "commonjs",
"target": "ES2022",
"allowSyntheticDefaultImports": true,
"removeComments": true,
"noImplicitAny": false,
"outDir": "./dist",
"baseUrl": "./",
@neverovski
neverovski / .editorconfig.json
Last active October 1, 2021 07:09
EditorConfig settings
# EditorConfig is awesome: https://EditorConfig.org
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@neverovski
neverovski / .prettierrc.json
Last active October 1, 2021 07:09
Prettier Settings
{
"arrowParens": "always",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"bracketSpacing": true,
"endOfLine": "lf"
}
@neverovski
neverovski / tsconfig.json
Last active August 12, 2022 11:33
TSConfig for React
{
"extends": "./tsconfig.paths.json",
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
@neverovski
neverovski / .eslintrc.json
Last active August 12, 2022 11:32
ESLint for React
{
"settings": {
"import/resolver": {
"typescript": {}
}
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react-hooks",
@neverovski
neverovski / timezone.json
Last active August 11, 2022 07:22
JSON TimeZone List
[
{
"name": "(GMT-11:00) Pacific/Niue",
"utc": "Pacific/Niue",
"offset": -11
},
{
"name": "(GMT-11:00) Pacific/Pago Pago",
"utc": "Pacific/Pago Pago",
"offset": -11
@neverovski
neverovski / language.json
Last active August 11, 2022 07:22
JSON Language List
[
{
"code": "ab",
"name": "Abkhaz",
"nativeName": "аҧсуа"
},
{
"code": "aa",
"name": "Afar",
"nativeName": "Afaraf"
@sindresorhus
sindresorhus / esm-package.md
Last active July 3, 2024 01:26
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@zmts
zmts / fingerprint.md
Last active July 26, 2023 08:12
Get browser fingerprint example (fingerprintjs2)

Get browser fingerprint example (fingerprintjs2)

import * as Fingerprint2 from 'fingerprintjs2'
import * as UAParser from 'ua-parser-js'

function _getFingerprint () {
  return new Promise((resolve, reject) => {
    async function getHash () {
      const options = {