What is basic requirement to create node library? How to deploy node packages? I am sure there must already a reddit discussion about this, so if you know please ping me
Tip Reveddit Real-Time can notify you when your content is removed.
I created a template for this, a Node.JS lib written in TypeScript.
The blog post is here: https://f3rno64.io/a-modern-nodejs-typescript-lib-template
The GitHub repo is here: https://github.com/f3rno64/node-ts-lib-template
Feel free to fork it. Let me know if you find it useful!
npm init && npm publish
The bare minimum. Better though is something like https://x.com/bitandbang/status/1082331715471925250
Neither npm nor npx nor GitHub owned NPM are necessary nor required to create a Node.js library.
You must be fun to work with.
Missing from your comment is any refutation of the technical facts I posted. Because you can't refute the technical facts I posted.
You had better have somebody on your crew that is not caught up in having fun at work, rather is looking at the prints and vetting everybody's claims and work. It's called V.I.F.: Verify in the Field.
You must be fun to work with.
You sensitive needs folks wouldn't last 2 minutes in the domains I purvey my wares.
FYI my last 2 gigs have been by referral. Not because I am chumming it up with folks. Because of my attention to detail and not trying to chum it up with folks. I am going to ask questions, and make sure no garbage is sent through the window.
Thanks for proving my point so throughly.
You are talking about your emotions. You are carefully staying away from the technical facts I posted.
I don't go to work to make friends. I have enough friends already. I certainly ain't on these boards to make friends or appease folks' sensitive needs or give little Billy a virtual hug.
Write some code. Publish the code on GitHub and/or GitLab.
It’s true! The absolute bare minimum is a JS file available for people to download. This is pretty idiotic advice though. If you actually want users to leverage your library there are many varying levels of effort you will need to put in order to attract developers to use it.
You’ve (@op) gotten plenty of useful advice already in other comments so I’ll refrain from repeating what’s been said. The process may feel daunting (or not) but it’s actually simple, if not a bit involved in some areas depending on exactly how much effort your wanting to do up front (docs, types, etc.) outside of your actual library.



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.