Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESM version #3

Closed
Konakona-chan opened this issue Oct 14, 2021 · 2 comments
Closed

ESM version #3

Konakona-chan opened this issue Oct 14, 2021 · 2 comments

Comments

@Konakona-chan
Copy link

Hello there.

As for 2021, NodeJS versions <12 without ESM support (are deprecated)[https://nodejs.org/en/about/releases/]. To use modern standard spec and features like top-level await natively, dependencies should be converted to ESM. There are some solutions in specific packers like Vite/Snowpack, but they are unreliable (because they, for example, are trying to traverse through the codebase with regular expressions and replace module. with exports , etc.), see vitejs/vite#3024. Moreover, as a developer, I want to be able to use mdurl (indirectly) in tests and cmd utilities without extra bundlers/packers. Other benefits include:

  • ESM packages can be imported by Deno, Browser and Node.
  • ESM in NodeJS can import cjs packages as well (the reverse is not true for cjs unless you don't use async import(..))
  • ESM are more secure by design in a way that it can't be tamper because ESM exports are frozen/immutable by default
@puzrin
Copy link
Member

puzrin commented Oct 14, 2021

This package is done specially for markdown-it (as said in readme), and not recommended for other use. I don't like to change development process "just for fun". markdown-it itself already has ESM build.

@puzrin puzrin closed this as completed Oct 14, 2021
@tobiasdiez
Copy link

With some other tools/modules now using mdurl (in my case nuxt/content), could you please reconsider this and provide an esm version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants