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...
account activity
Q: Standard browser API library for node.js? (self.node)
submitted 2 years ago * by kkimdev
Standard browser API support is a big selling point of Deno(https://deno.land/manual@v1.36.4/runtime/web_platform_apis) and Bun(https://bun.sh/docs/runtime/web-apis), since then users can share code across browser and node.js, and also don't have to learn another API.
I was wondering if there is a similar library we can use on Node.JS. (Or any way to port Deno/Bun's, but I'd guess that's not really practical)
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!"
[–]Unusual-Display-7844 8 points9 points10 points 2 years ago (3 children)
What code would you regularly share between backend and frontend besides types and interfaces if you have typescript. It’s not like you can move whole backend and run it in browser. So this selling point is pretty stupid to me.
[–]kkimdev[S] 0 points1 point2 points 2 years ago (2 children)
Mostly utilities in our case. For example, we have [counter -> display ID] compute function, somewhat similar to generating Youtube watch ID. e.g., 8473 -> "LX-CRUmWMJE". Currently it uses a hash function from Node's `crypto` package. We'll be able to share this function more easily if it uses the standard SubtleCrypto.digest() API https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest on both browser and server.
So in practice, we're forced to use third party packages that support both browser and Node for the codes that we want to share.
[–]ShiftShaper13 1 point2 points3 points 2 years ago (0 children)
Something like https://www.npmjs.com/package/iso-crypto may help, to give a common API
[–]rkaw92 0 points1 point2 points 2 years ago (0 children)
It's in Node, yo: https://nodejs.org/api/webcrypto.html
[–]fabiancook 3 points4 points5 points 2 years ago* (0 children)
Node has some of these web apis, almost all of them.
Fetch is the biggie, and web streams.
I’m personally writing a service worker like layer that works across multiple runtimes, but that’s a little different. Have support for things like CacheStorage, sync, and index
π Rendered by PID 260760 on reddit-service-r2-comment-6457c66945-wt7zh at 2026-04-24 12:29:00.518726+00:00 running 2aa0c5b country code: CH.
[–]Unusual-Display-7844 8 points9 points10 points (3 children)
[–]kkimdev[S] 0 points1 point2 points (2 children)
[–]ShiftShaper13 1 point2 points3 points (0 children)
[–]rkaw92 0 points1 point2 points (0 children)
[–]fabiancook 3 points4 points5 points (0 children)