Skip to content

Instantly share code, notes, and snippets.

View soheilpro's full-sized avatar

Soheil Rashidi soheilpro

View GitHub Profile
@soheilpro
soheilpro / esm-package.md
Created October 9, 2023 15:20 — forked from sindresorhus/esm-package.md
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.
@soheilpro
soheilpro / example.sh
Last active August 3, 2022 18:42
Easy IIS log file format specification for goaccess.
goaccess -f u_ex150629.log --log-format "$(cat u_ex150629.log | ./goiisformat.sh)" --date-format '%Y-%m-%d' --time-format '%H:%M:%S'
@soheilpro
soheilpro / csvparser.js
Last active August 29, 2015 14:22
CSV Parser in JS
function ValueToken(value) {
this.value = value;
}
function CommaToken() {
}
function NewLineToken() {
}