Updated Aug 2024. For looking up trending newer alternatives, use npmtrends. For Nodejs, nodejstoolbox a precompiled list of trends by category.
Standard libs extend the runtime with convenience helpers, structures and patterns. Use these two in order
- FxTS functional stdlib with async pipe. Basically, async fp lodash, tree shakable, iterator-based with lazy eval.
- es-toolkit stdlib; direct lodash successor
- attempt for retry logic
Others too fill some missing utilities:
- safe-assignment go-like error handling while waiting for Safe Assignment Operator
- streaming-iterables async iterator tools (overlaps with FxTS) until we get https://github.com/tc39/proposal-async-iterator-helpers
- modern-async functional stdlib with synchronization patterns: Queue, Scheduler, Delayer, Deferred, timeout + async array methods with concurrency and cancelling.
- radashi functional stdlib with some async tools
- just dep-free standalone stdlib tools
- async-mutex mutexes
- attempt promise retry
- dayjs datetime
- deepmerge-ts modern deep merge
- error-serializer cross-engine error serialization (alt for node <18.18: serialize-error)
- immer immutable updates without clone (see use-immer for use in react)
- js-sdsl performant data structures
- kysely typesafe SQL query builder with auto migrations and an ORM layer; supports most JS envs and most DBs (alt: drizzle-orm)
- magic-regexp compiled declarative string matching
- memoize-one last-invocation memoization (more complex and powerful alternative: memoizee)
- micromatch glob matching (MATCHING ONLY) (alt: minimatch)
- typed-emitter 0kb strict typings for
node:events
. Alternative if a full implementation is needed: mitt - natural-orderby orderBy with natsort built-in. update use
.sort((a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' }))
- redlock distributed redis locks
- superjson (de-)serialization with advanced types (alt: avsc)
- tinybench universal benchmark
- transliteration utf8>ascii
- ts-pattern pattern matching for cleaner, typesafe and exhaustive conditions
- ts-results rust-like Result and Option patterns
- uuid uuids (dict conversion for uuids: short-uuid; hashing alternative: hashids)
- workerpool Parallel execution using
node:worker_thread
orWebWorker
(alternative: piscina node only but well used) - wretch better fetch
- xstate state machines — come with an optional graphical editor
- zod type-safe validation
- bull redis-backed distributed jobs and messages
- clack CLI Prompts
- exit-hook cleanup on exit (bonus: http-terminator to kill http connections)
- pino logging (alternatives: tslog (more modern) or debug (og))
- supertest node HTTP Testing
- tmp-promise temp files and folders with auto cleanup
- yargs argv parser (alternatives: oclif high-level framework)
- ahooks hook lib (alternative: react-use)
- suspend-react async-await for components
- use-immer immer-backed swap-in for useState and useReducer
- jotai global state managers (alternatives: zustand, signia)
- chokidar-cli fast cross-platform cli utility to watch file system changes (alternative: watchexec)
- concurrently run commands concurrently
- dotenv-vault sync encrypted dotenv files (alternative: doppler.com)
- env-cmd setting environment variables from a file
- tsx esbuild-enhanced node replacement.
- Payments: Lemon Squeezy, Stripe, Paddle
- Use data structures from js-sdsl;
- For optimizing search complexity,
OrderedSet
andOrderedMap
can provide boosts to intersection/difference operations even when identity-sorted on an alphanumeric ID. - For optimizing mutability,
Stack, Queue, PriorityQueue, LinkList and Deque
- For optimizing search complexity,
- Use FxTS for operations on sets. All common array operations + lodash-alikes are supported
- https://regex101.com/ regex building tool
- https://requestcatcher.com/ test incoming requests online
- https://stately.ai/ state machine creator
- https://www.speedscope.app/ universal flamegraph inspector
- https://www.drawdb.app/ db schema mockups and schema generator
- https://bundlejs.com/ npm package size checker with an editor to test tree-shakability
- https://github.com/sharkdp/hyperfine benchmark commands
- https://github.com/hatoo/oha http load tester
- https://github.com/acrazing/dpdm/ circular dependency detector for debugging weird import errors (used before initialization, cannot read property x of undefined that is clearly there, etc)
- https://github.com/microsoft/deoptexplorer-vscode performance bottlenecks finder
- https://github.com/discoveryjs/cpupro?tab=readme-ov-file next gen cpu profiling for node/deno/chrome
- https://github.com/oauth2-proxy/oauth2-proxy authwall for internal tools
- https://github.com/Infisical/infisical secret management