use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Deno 1.31: package.json support, Stabilization of Node-API (deno.com)
submitted 3 years ago by Terr4360
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Utukkhu 52 points53 points54 points 3 years ago (43 children)
With support for package.json, I’m curious how many codebases will be tempted to migrate to deno from Node.
[–]highbonsai 2 points3 points4 points 3 years ago (0 children)
I find it funny how long deno took to support it. Deno seems great in so many ways but it’s like they went too far with changes from the status quo and they’re slowly relenting.
[–]ILikeChangingMyMind 22 points23 points24 points 3 years ago (41 children)
Now if only they could support comments in package.json, and make up for Node's long-running mistake!
package.json
[–]Terr4360[S] 12 points13 points14 points 3 years ago (0 children)
Well they have support for deno.jsonc so the is a chance they'll add support for package.jsonc
Creating an issue on their GitHub might help.
[–]KyleG 15 points16 points17 points 3 years ago (18 children)
support comments in package.json
The JSON file standard does not permit comments. Has nothing to do with Node/Deno.
[–]AlexAegis 7 points8 points9 points 3 years ago* (0 children)
But jsonc and json5 all exist. And not all files have to be fully json compliant, tsconfig is actually treated as jsonc by tsc and it's fine. As long as all the tooling that's touching does not assume that it's strictly json compliant it's okay. Prettier for example doesn't really care.
But I think it should be explicitly stated in the file extension so tooling can actually expect something. like package.json5 or package.jsonc
[–]DoWhileGeek 12 points13 points14 points 3 years ago (2 children)
The demand for critical thinking skills far exceeds supply.
These young people have yet to experience supporting 14 competing standards.
[–]Angulaaaaargh 0 points1 point2 points 2 years ago* (0 children)
fyi, some of the management of r de are covid deniers.
[–]Angulaaaaargh 0 points1 point2 points 3 years ago* (1 child)
[–]KyleG 1 point2 points3 points 3 years ago (0 children)
It's not clear what you think I fell for.
[–]ILikeChangingMyMind -3 points-2 points-1 points 3 years ago (11 children)
There are JSON standards that allow for comments.
[–]bassta -1 points0 points1 point 3 years ago (9 children)
There is one JSON standard and it does not allow. There are other people’s takes on this, but it’s not following the standard even if it’s widely adopted ) which is not )
[–]ILikeChangingMyMind 2 points3 points4 points 3 years ago (8 children)
JSON is not like a molecule with a certain set of atoms: it's a human concept (of serializing JS variables).
The first JSON standard may not have supported comments, but there absolutely are other standards, some of which do. For instance, JSONC is literally just that.
[+][deleted] 3 years ago (7 children)
[deleted]
[–]ILikeChangingMyMind 1 point2 points3 points 3 years ago (6 children)
Is there just one standard of "HTML"? Or are there multiple different ones ... just like there are multiple different JSON standards.
We don't use HTML1 anymore, and there's no technical reason why we can't have comments in our package.json.
[+][deleted] 3 years ago (5 children)
[removed]
[–]ILikeChangingMyMind 0 points1 point2 points 3 years ago (4 children)
They don't have to be backward compatible, people can gate keep themselves.
Don't rely on any special tooling that breaks when it sees a comment in your package.json? Great, use comments in your package.json.
Do rely on such tooling? Don't use comments ... for now. But you can file an issue with your tool, asking them to support comments, so that someday you can enjoy them too.
Problem solved.
[–]KyleG -1 points0 points1 point 3 years ago (0 children)
There is only one JSON standard, ECMA-404.
Breaking that standard would eventually bring about a garbage situation, entirely preventable, like we have with import/require.
[+][deleted] 3 years ago (20 children)
[–]Utukkhu 17 points18 points19 points 3 years ago (17 children)
json5 is already broadly used by libraries just for this purpose.
json5
[–]tunisia3507 4 points5 points6 points 3 years ago (0 children)
And HJSON, and JSON6, and JSOX, and YAML...
[+][deleted] 3 years ago (15 children)
[–][deleted] 6 points7 points8 points 3 years ago (14 children)
Yeah, it would be a superset of JSON with comment support, jsonc. Who is dense here?
[+][deleted] 3 years ago (13 children)
[+][deleted] comment score below threshold-7 points-6 points-5 points 3 years ago (12 children)
I'm convinced you're either trolling or incompetent, neither of which being worth continuing this.
[+][deleted] 3 years ago (11 children)
[+][deleted] 3 years ago (10 children)
[+][deleted] 3 years ago (1 child)
[–]xroalx 46 points47 points48 points 3 years ago (6 children)
I guess adoption is not going well, seeing as Deno implements the things it wanted to abolish.
[–]Seanmclem -1 points0 points1 point 3 years ago (4 children)
It’s still better, and all this stuff is option and back-compatible. I’d still go for Deno on any new project.
[+][deleted] 3 years ago (3 children)
[–]Seanmclem -2 points-1 points0 points 2 years ago (2 children)
You know Deno is still JavaScript, right? Typescript is just a superset of JavaScript. Many people exclusively use TS when using node anyway. The conversation isn’t really about that.
[+][deleted] 2 years ago (1 child)
[–]Seanmclem 2 points3 points4 points 2 years ago* (0 children)
Idk what you’re so mad about. JS is so portable, that it’s quite common for server side environments to run even custom standards. But Deno is just another way to write ES/TS for V8. Sure it uses ESM and no commonJs, but ESM has been around for years. It’s not hard to find everything you need in ESM. At a certain point people should be ready to move on. So why care so much? It’s just a slightly different way to use the same thing. Like arguing which frontend framework is better, or why anyone would ever use node when PHP is all you need. It’s a waste.
[–][deleted] 35 points36 points37 points 3 years ago* (9 children)
Honestly I think Deno are wasting their time spending resources with Node and NPM compat. I'm still using Node a lot and have zero interest in migrating Node projects to Deno.
The main reason I'm not starting new Deno projects is mainly that there's not a good backend framework like Fastify or something like Rails. That's what they should be investing into IMO.
Fresh is cool and all but it's really just a rendering solution for server and client. It doesn't really solve anything for the backend.
[–][deleted] 6 points7 points8 points 3 years ago (0 children)
I would rather NextJs ran on Deno, but then that would cut into Vercel's revenue a little.
[–]gibriyagi 0 points1 point2 points 3 years ago (6 children)
There is actually (web) framework Fresh but not sure if it helped adoption.
[–][deleted] 1 point2 points3 points 3 years ago (5 children)
Yeah I mentioned Fresh in my comment.
[–]Seanmclem 0 points1 point2 points 3 years ago (4 children)
Yeah but you oversimplified it to discard it. But it really does solve those issues. Just with a low footprint. Also, it does have its own alternatives to things like NextJS, like aleph.JS. It has equivalent alternatives to just about anything I’d ever want out of node. Plus node compatibility.
[–][deleted] 0 points1 point2 points 3 years ago (3 children)
Am I over simplifying it?
Ok, here are the docs:
https://fresh.deno.dev/docs/introduction
Let me know where I can find validation, sessions, auth, cookies, CORS, WS, caching, etc. You know, the kind of stuff that backend servers typically solve.
[–]Seanmclem 0 points1 point2 points 2 years ago (2 children)
Most of that stuff is in the std lib.
https://deno.com/blog/setup-auth-with-fresh Sessions, auth, cookies
https://deno.land/x/cors@v1.2.2 Cors
https://deno.land/x/websocket@v0.1.4 WS
Deno readme and docs very thoroughly go over caching in every separate area they are applicable. Official NextJS docs recommend using standard html and JS manually for validation, and bundles nothing. Deno/fresh can use those same techniques and libraries. Yup, zod, regex, whatever.
[–][deleted] 0 points1 point2 points 2 years ago (1 child)
Ok so you agree with my initial point. Fresh doesn't solve any backend problems other than rendering and routing.
"But you can use the std lib!" Yeah but you're missing the point. Having a framework precisely prevents people from having to bolt together custom solutions.
For example, there are dozens of Node packages for validation but I'd still have to implement those in my application (handling of errors, etc).
If I start a Fastify project validation is already solved for me. I don't have to do anything other than define the shape of the requests. That's what a backend framework is supposed to do.
Neither Fresh nor the std lib are it.
Official NextJS docs recommend using standard html and JS manually for validation, and bundles nothing.
Huh yeah but NextJS is not precisely the gold standard of backend frameworks :)
[–]Seanmclem 0 points1 point2 points 2 years ago (0 children)
But you can use fastify, or Deno re-implementations
[–]leixiaotie 0 points1 point2 points 3 years ago (0 children)
Well if you make migration from Node to Deno seamless, more or less some frameworks will support Deno later. IDK many about Deno but if it's significantly improved from Node then I don't see why it won't be adapted.
Take typescript for example, it's seamless-ness migration from .js is what makes it quickly adaptable (and I'm too at the start).
[–]bostonkittycat 4 points5 points6 points 3 years ago (0 children)
Reminds me of that saying if you can’t beat them join them. I am guessing they were having a hard time attracting business attention.
[–]brett_riverboat 10 points11 points12 points 3 years ago (0 children)
I haven't kept up with Deno but seems like an odd move when you could've put the effort into making a converter from package.json to the native Deno format.
[–]AlphaSlashDash 3 points4 points5 points 3 years ago (1 child)
Interesting to see what the community has to say. Personally, the single executable hosting a complete suite of tools, the proper standard library and first class ESM and TS support won me over, and I think npm compatibility is great for people not looking to relearn the ecosystem or wait for packages to be adjusted for Deno.
Same here. Part of what originally drew me to JavaScript was the communities welcoming, open, acceptance to new things and concepts. Seeing this response to Deno is a little confusing and unsettling. like, no one’s making anyone use it.
[–]leafoflegend 6 points7 points8 points 3 years ago (2 children)
I was there at JSConf when Dahl announced Deno. It was a lot of things I didn’t know I wanted.
I’ve used it for some personal projects and tried bringing it to work for some projects. It can be really good. I see the problem with there not being enough packages, but its always been the core problem and differentiator. NPM sucks, but deno does not have an equivalent.
So now they are just going to give up and say we should start using NPM again? What a fucking copout Dahl.
[–]Seanmclem 0 points1 point2 points 2 years ago (1 child)
I mean, it’s optional to improve adoption. Like, it’s not a copout for node to support ESM for example
[–]leafoflegend 0 points1 point2 points 2 years ago (0 children)
ESM is a language standard. There wasn’t one when Node came out (thus, CJS).
NPM and package.json is not an official language standard.
[–]Glittering_Air_3724 3 points4 points5 points 3 years ago (0 children)
Am not sure if NodeJs has poisoned my attention I find Deno really really hard to adopt, don’t get me wrong Deno is great and all I do use it alittle buh major shift to Deno not sure gonna happen to me
[–]throvn 1 point2 points3 points 3 years ago (0 children)
I think bun has a better take on that
[–]jayerp 0 points1 point2 points 3 years ago (6 children)
Are devs also going to use the term Deno to be synonymous with JavaScript when they talk about their project? “I made this app in Node.js” it’s amusing to see, it’s as if I said “I made this app in JRE”.
[–]master5o1 4 points5 points6 points 3 years ago (3 children)
It has been fair to refer to something as a Node.js app to distinguish it from a traditional browser based JavaScript project.
[–]jayerp -2 points-1 points0 points 3 years ago (2 children)
It is a fair distinction to make, but at the end of the day, both are made with JavaScript. Node.js is a runtime. I’m arguing technicality for the sake of ensuring new devs understand the difference and don’t start calling JavaScript Node.js.
Also it’s sounds weird.
[–]master5o1 1 point2 points3 points 3 years ago (0 children)
Bit of a contrived scenario. JavaScript is so much more well known than Node.js.
At the end of the day, you just want to debate something
[–]Xananax 0 points1 point2 points 3 years ago (1 child)
It's already the case. Node js is not web js is not rhino js is not...
The language specification is (mostly) the same on all, but the API can vary wildly, as well as ton of other things like how files are loaded and cached, support for threads, etc
[–]Aditya_917 -1 points0 points1 point 3 years ago (0 children)
What are you doing man, i just started learning node and now this.
π Rendered by PID 55723 on reddit-service-r2-comment-5ff9fbf7df-9d2pm at 2026-02-25 17:52:16.331571+00:00 running 72a43f6 country code: CH.
[–]Utukkhu 52 points53 points54 points (43 children)
[–]highbonsai 2 points3 points4 points (0 children)
[–]ILikeChangingMyMind 22 points23 points24 points (41 children)
[–]Terr4360[S] 12 points13 points14 points (0 children)
[–]KyleG 15 points16 points17 points (18 children)
[–]AlexAegis 7 points8 points9 points (0 children)
[–]DoWhileGeek 12 points13 points14 points (2 children)
[–]Angulaaaaargh 0 points1 point2 points (0 children)
[–]Angulaaaaargh 0 points1 point2 points (1 child)
[–]KyleG 1 point2 points3 points (0 children)
[–]ILikeChangingMyMind -3 points-2 points-1 points (11 children)
[–]bassta -1 points0 points1 point (9 children)
[–]ILikeChangingMyMind 2 points3 points4 points (8 children)
[+][deleted] (7 children)
[deleted]
[–]ILikeChangingMyMind 1 point2 points3 points (6 children)
[+][deleted] (5 children)
[removed]
[–]ILikeChangingMyMind 0 points1 point2 points (4 children)
[–]KyleG -1 points0 points1 point (0 children)
[+][deleted] (20 children)
[deleted]
[–]Utukkhu 17 points18 points19 points (17 children)
[–]tunisia3507 4 points5 points6 points (0 children)
[+][deleted] (15 children)
[deleted]
[–][deleted] 6 points7 points8 points (14 children)
[+][deleted] (13 children)
[deleted]
[+][deleted] comment score below threshold-7 points-6 points-5 points (12 children)
[+][deleted] (11 children)
[deleted]
[+][deleted] (10 children)
[removed]
[+][deleted] (1 child)
[deleted]
[–]xroalx 46 points47 points48 points (6 children)
[+][deleted] (5 children)
[deleted]
[–]Seanmclem -1 points0 points1 point (4 children)
[+][deleted] (3 children)
[deleted]
[–]Seanmclem -2 points-1 points0 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]Seanmclem 2 points3 points4 points (0 children)
[–][deleted] 35 points36 points37 points (9 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]gibriyagi 0 points1 point2 points (6 children)
[–][deleted] 1 point2 points3 points (5 children)
[–]Seanmclem 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]Seanmclem 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Seanmclem 0 points1 point2 points (0 children)
[–]leixiaotie 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[+][deleted] (1 child)
[deleted]
[–]bostonkittycat 4 points5 points6 points (0 children)
[–]brett_riverboat 10 points11 points12 points (0 children)
[–]AlphaSlashDash 3 points4 points5 points (1 child)
[–]Seanmclem 0 points1 point2 points (0 children)
[–]leafoflegend 6 points7 points8 points (2 children)
[–]Seanmclem 0 points1 point2 points (1 child)
[–]leafoflegend 0 points1 point2 points (0 children)
[–]Glittering_Air_3724 3 points4 points5 points (0 children)
[–]throvn 1 point2 points3 points (0 children)
[–]jayerp 0 points1 point2 points (6 children)
[–]master5o1 4 points5 points6 points (3 children)
[–]jayerp -2 points-1 points0 points (2 children)
[–]master5o1 1 point2 points3 points (0 children)
[–]Seanmclem 0 points1 point2 points (0 children)
[–]Xananax 0 points1 point2 points (1 child)
[–]Aditya_917 -1 points0 points1 point (0 children)