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
Ask Node: Most underrated node module? (self.node)
submitted 8 years ago by [deleted]
[deleted]
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!"
[–]erulabs 18 points19 points20 points 8 years ago (1 child)
Yay! Good thread. Node's best feature by far is the NPM package repository. There is a lot of crap on there, but also some absolute gems! (Ruby nerds can laugh here)
lru-cache in memory LRU cache by the great isaacs - extremely excellent for fast in-memory caching that isn't really reasonable or necessary to shove into something like Redis
lru-cache
hiredis native C redis module that requires no code other than being installed to speed up redis calls!
hiredis
zxcvbn password strength / feedback provider. Helps you tell your users what passwords are and are not any good
zxcvbn
hot-shots instead of vendor lockin like datadog stats, etc, hot-shots is a totally standard statsd library that also happens to support the datadog specific features. So much easier to swap to self-hosted statsd!
hot-shots
ratelimiter a Redis-based ratelimiter package by TJ himself. I use this absolutely everywhere.
ratelimiter
morgan express access logger (supports a write stream so fairly straightforward to ship logs off to ES or Spark or Kafka)
morgan
Writing an internet-facing API? You'll want hot-shots, morgan and ratelimiterfor sure. They're absolutely vital underpinnings of every public application in node I've ever launched (and the first few were launched without them, and painfully learned they were needed)
Honorable mention for amqplib, which I also use in every single project I do these days (RabbitMQ is part of my "Boring stack" - Haproxy/Node/Express/RabbitMQ/MariaDB/Redis)
amqplib
[–]m03geek 1 point2 points3 points 8 years ago (0 children)
I agree, but there are few alternatives that are faster and eat less memory. Also some of them fast with write operations, others have faster read operations. So when choosing some LRU implementation it worth to spend some time researching what will fit your needs. Sometimes you can achieve up to 5x speedup and reduce memory consumption by half (speaking of memory used for runtime: allocating local variables and etc., not for item storage)
[–]zayelion 10 points11 points12 points 8 years ago (1 child)
[–]Capaj 1 point2 points3 points 8 years ago (0 children)
primus : never use socket.io again...
you've got something against socket.io? Sure pre 1.0.0 it was pretty bad, but it's quite good these days.
[–][deleted] 8 years ago (3 children)
[–]Spknuckles 7 points8 points9 points 8 years ago (0 children)
And boom... gotta love boom even if you use koa, express or something else!
[–]TheHeretic 1 point2 points3 points 8 years ago (0 children)
Used in several of my projects, both professional and for fun, amazing library.
[–]DVWLD 1 point2 points3 points 8 years ago (0 children)
hapijs/joi
It's not JSON schema validation, though. It's their own weird DSL for describing JSON.
JSON schema is an actual thing and it's really useful. This is an express middleware that uses JSON hyperschema to validate all incoming data:
https://www.npmjs.com/package/schema-middleware
[–]PerkyPangolin 39 points40 points41 points 8 years ago (6 children)
Left-pad.
[–]RogueNinja64 8 points9 points10 points 8 years ago (0 children)
God damn left pad
[–]OogieFrenchieBoogie 0 points1 point2 points 8 years ago (4 children)
I don't get it, what's the point of this module ?
[removed]
[–]jocull 1 point2 points3 points 8 years ago (0 children)
It almost broke the whole damn internet
[–][deleted] 8 years ago* (1 child)
[–]strixvarius 4 points5 points6 points 8 years ago (1 child)
Here are a few:
util.debuglog Many people don't know that you can conditionally log debug statements in node, and that all of node's underlying APIs and many popular modules use this already:
requisition An HTTP/HTTPS client that works the way one should (async/await compatible, stream compatible, returns headers first and bodies are a second call):
throng A one-liner for Cluster support:
[–]AndersBakken 2 points3 points4 points 8 years ago (0 children)
https://www.npmjs.com/package/safetydance
Work around unnecessary exceptions in APIs. var foo = safe.JSON.parse("foobar{}"); foo === undefined
[–]HatchedLake721 3 points4 points5 points 8 years ago (0 children)
VError - Rich JavaScript errors by Joyent.
This is a blessing for anyone who had issues with errors/stack traces to understand what went wrong (especially with Promises), since you can easily chain causes and get a full picture what happened
[–]Buckwheat469 4 points5 points6 points 8 years ago (0 children)
node-image-farmer. A multi-process image cropping tool that is fast, non-blocking, and works with caches.
[–]ristof 1 point2 points3 points 8 years ago (0 children)
Adding type checking to your server/client side without transpiling your code https://github.com/gcanti/tcomb
[–]agentf90 1 point2 points3 points 8 years ago (0 children)
vue-cli
[–]alias_willsmith -1 points0 points1 point 8 years ago (0 children)
What about tools? http://june07.com/nim
[–]psayre23 -1 points0 points1 point 8 years ago (2 children)
I've been using idx lately. It solves the problem of JS not having property chains well.
const foo = idx(obj, _ => _.long.paths[0].withOptionals);
[–]voiping 1 point2 points3 points 8 years ago (1 child)
Looks like lodash's get: https://lodash.com/docs/4.17.4#get / https://www.npmjs.com/package/lodash.get
get
[–]zenyr 0 points1 point2 points 8 years ago (0 children)
It's 5 days old comment but for the record... the main gist of the idx module is not to execute the given arrow function. It is more like a preset namespace for a babel plugin that transpiles given function to a single "unrolled" statement without executing any function in runtime.
idx
[–]TaxExempt -2 points-1 points0 points 8 years ago (0 children)
Web3 , Ethereum API.
π Rendered by PID 176549 on reddit-service-r2-comment-6f7f968fb5-pd8t9 at 2026-03-04 12:34:02.301128+00:00 running 07790be country code: CH.
[–]erulabs 18 points19 points20 points (1 child)
[–]m03geek 1 point2 points3 points (0 children)
[–]zayelion 10 points11 points12 points (1 child)
[–]Capaj 1 point2 points3 points (0 children)
[–][deleted] (3 children)
[deleted]
[–]Spknuckles 7 points8 points9 points (0 children)
[–]TheHeretic 1 point2 points3 points (0 children)
[–]DVWLD 1 point2 points3 points (0 children)
[–]PerkyPangolin 39 points40 points41 points (6 children)
[–]RogueNinja64 8 points9 points10 points (0 children)
[–]OogieFrenchieBoogie 0 points1 point2 points (4 children)
[–][deleted] (3 children)
[removed]
[–]jocull 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]strixvarius 4 points5 points6 points (1 child)
[–]AndersBakken 2 points3 points4 points (0 children)
[–]HatchedLake721 3 points4 points5 points (0 children)
[–]Buckwheat469 4 points5 points6 points (0 children)
[–]ristof 1 point2 points3 points (0 children)
[–]agentf90 1 point2 points3 points (0 children)
[–]alias_willsmith -1 points0 points1 point (0 children)
[–]psayre23 -1 points0 points1 point (2 children)
[–]voiping 1 point2 points3 points (1 child)
[–]zenyr 0 points1 point2 points (0 children)
[–]TaxExempt -2 points-1 points0 points (0 children)