1.0.5 • Published 4 years ago

autoesm v1.0.5

Weekly downloads
71
License
MIT
Repository
github
Last release
4 years ago

autoesm

Node@13+ supports ES modules natively, but doesn't let importing arbitrary modules − it requires either "type": "module" in package.json or .mjs file extension to indicate that the file is ESM.

autoesm resolves that by detecting ESM based on source, (not extension), allowing to import any ESM files (like existing ESM ecosystem with "module" field in package.json for unpkg/pikacdn).

Slow? Maybe. Runtime flag is a bummer too. In long term all ESM packages will get "type": "module" flag, but for now it saves nerves and time for running tests.

Also - the esm is broken for node@13+, so this is the replacement.

Usage

npm i autoesm

Providing node@13+ is used:

node --experimental-loader autoesm ./test.js
1.0.5

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago