11
Creating first node library(self.node)
What is basic requirement to create node library? How to deploy node packages? I am sure there mus...
since 2 years ago
12 of 12
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


None of those are basic requirements though, those are just opinions. The actual requirement is to create an NPM account, a package.json file, and at least 1 .js file and npm publish.
You are right. But I would not install a package without sourcemaps or if I have to use a transpiler. It increases project complexity and makes it hard to maintain. This are "opinions" that I believe should be the "goto" for every node developer creating packages because it improves de environment.
I've added a really simple example I did few months ago. You can change it to do what you need.
.mjsextension is no longer necessary.node --experimental-default-type=module file.js> no longer necessary
> use this experimental feature thats not even available on all current maintained versions of node
???
I only run
nodenightly release.ESM:
--experimental-default-type flagto flip module defaultsI didn't ask what the feature does, im aware of it, the problem is that you're suggesting that he bundles esm js files instead of mjs because... you use nightly with experimental flag so ignore everything else?
To be such Node.js fans you folks sure ain't keeping up with what's going on in Node.js world.
This ain't 2009.
What part of the PR to merge the flag into v18.19.0 do you not understand?
Ecmascript standardized Ecmascript Modules, not CommonJS.
You still don't get it do you? The flag is experimental and not in all maintained versions of node, and the common behavior right now is to count js files without type: module as cjs, you are asking him to ship a package that is broken and only works under a experimental flag.. It doesn't matter even if it was in v18. You're literally acting like a child saying that the pr might merge that enables this experimental flag that their users might not even know to use! You are literally suggesting the guy to gate the lib under a experimental flag wtf?
If the flag exists the flag can be used until the flag does not exist. I highly suspect Node.js maintainers are not going to go backwards on this issue. CommonJS is over. .cjs and .ms are over. WinterCG ain't talking about CommonJS. Nobody accept folks exclusively tethered to stable Node.js releases, and the Bun folks who managed to figure out how to run CommonJS and Ecmascript Modules in the same file before Node.js maintainers!
Now, it might be a whole bunch of common folks exhibiting common behavior. I ain't common.
I'm on the edge. I actually test multiple tip-of-tree JavaScript engines, runtimes, and browsers. You folks ain't testing anything. You're reading the Node.js stable release like it's gospel and think that's "common behavior". Well, it might be from a myopic perspective. Not in the field where developers and hackers are on the cutting edge developing and hacking up JavaScript from all angles.