Documentation flaw? #65
-
Hi! I am pretty new to node and wanted to play around with rehype so wanted to play with the example from the readme: https://github.com/rehypejs/rehype-document#use I immediatly got:
I have node version Pretty sure that this only relevant for node beginners like me but I think it would be nice to have an example that is working right out of the box. I got it to work by naming the example Since I know that grasping the beginner difficulties is hard if you are deep into the topic I hope this input is useful for you. greetings! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @agutenkunst! 👋
The linked document (https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) introduces ESM and how to use it with a number of different tools. Using the |
Beta Was this translation helpful? Give feedback.
Hey @agutenkunst! 👋
Sorry you ran into a spot of trouble.
The section above the example tries to give guidance here:
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.