LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
✖︎
about reveddit
⚙F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
11
Creating first node library(self.node)
submitted 2 years ago by [deleted] to /r/node (327.7k)
22 commentsredditother-discussionssubreddit-indexmessage mods

What is basic requirement to create node library? How to deploy node packages? I am sure there mus...

... view full text

since 2 years ago
12 of 12

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
you are viewing a single comment's thread.
view all comments
[–][deleted]18 points2 years ago
[deleted] by user
(check your username's removed content. why?)
hide replies (3)as-of
[–]gigastack3 points2 years ago

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.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]Positive_Method30221 point2 years ago

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.

permalinkparentcontextauthor-focusas-ofpreserve
[–]Positive_Method30221 point2 years ago

I've added a really simple example I did few months ago. You can change it to do what you need.

permalinkparentcontextauthor-focusas-ofpreserve
[–]guest271314-12 points2 years ago

.mjs extension is no longer necessary.

node --experimental-default-type=module file.js

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]MastonDZN7 points2 years ago

> no longer necessary

> use this experimental feature thats not even available on all current maintained versions of node

???

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]guest271314-4 points2 years ago

use this experimental feature thats not even available on all current maintained versions of node

I only run node nightly release.

ESM: --experimental-default-type flag to flip module defaults

We are also exploring using detection of ES module syntax as a way of Node.js knowing when to interpret files as ES modules. Our goal is to eventually find a way to support ES module syntax by default with minimal breaking changes.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]MastonDZN3 points2 years ago

I 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?

permalinkparentcontexthide replies (2)author-focusas-ofpreserve
[–]guest271314-2 points2 years ago

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.

permalinkparentcontextauthor-focusas-ofpreserve
[–]guest271314-3 points2 years ago

What part of the PR to merge the flag into v18.19.0 do you not understand?

The new flag --experimental-default-type can be used to flip the default module system used by Node.js.

Ecmascript standardized Ecmascript Modules, not CommonJS.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]MastonDZN1 point2 years ago

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?

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]guest271314-4 points2 years ago

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.

permalinkparentcontextauthor-focusas-ofpreserve
r/revedditremoved.substack.com
🚨 NEWS 🚨
✖︎

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com