Skip to content

Documentation flaw? #65

Discussion options

You must be logged in to vote

Hey @agutenkunst! 👋
Sorry you ran into a spot of trouble.
The section above the example tries to give guidance here:

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

The linked document (https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) introduces ESM and how to use it with a number of different tools.

Using the .mjs extension is one option.
Another, is adding "type": "module", to package.json, which enables ESM for .js files in Node.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@agutenkunst
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants