Skip to content

Require Node.js 12.20 and move to ESM#4

Open
jimmywarting wants to merge 3 commits intojonschlinkert:masterfrom
jimmywarting:master
Open

Require Node.js 12.20 and move to ESM#4
jimmywarting wants to merge 3 commits intojonschlinkert:masterfrom
jimmywarting:master

Conversation

@jimmywarting
Copy link
Copy Markdown

No description provided.

@onokumus
Copy link
Copy Markdown
Contributor

@jimmywarting

This module is CommonJs module. But your pull-request is ES module. For example, the following code will not work in your pull-request.

var isExtendable = require('is-extendable');

console.log(isExtendable({})); // ERR_REQUIRE_ESM Error

https://github.com/jonschlinkert/is-extendable/network/dependents

@jimmywarting
Copy link
Copy Markdown
Author

That was my intention.
Many are switching to ESM now days cuz cjs and esm can not get along
it's also a good thing cuz then you can import this project in Deno and Browser without the need of NPM or any package mananger

esm have been supported for a long time now and you can still import the package from commonjs, just you have to use the async import() method

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

@jimmywarting
Copy link
Copy Markdown
Author

ppl who still wants to use this can use a older version.

@onokumus
Copy link
Copy Markdown
Contributor

@jimmywarting
You should at least release the package as hybrid.

https://2ality.com/2019/10/hybrid-npm-packages.html

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 this pull request may close these issues.

2 participants