Skip to content

About

⭐ Awesome Node Cheats

Resources

Security policy

Stars

423 stars

Watchers

23 watching

Forks

Repository files navigation

node-cheat

The sequel for the AI era: ai-cheat — tested fixes for the problems developers (and their AI assistants) get stuck on, each one answering a real question.

Small, runnable Node.js examples for everyday tasks: cloud storage, payments, email/SMS, real-time chat, files, databases and more. They were first written in 2016–2018 and rewritten in 2026 for current Node.js and current library versions.

CI

What "modern" means here

  • Node.js 22+ (.nvmrc pins 24), native ES modules, node: built-ins
  • async/await everywhere and built-in fetch; no callbacks, request, q or async.js
  • Current SDKs: AWS SDK v3, Stripe PaymentIntents, Express 5, socket.io 4, MongoDB 7, Mongoose 9, node-redis, twitter-api-v2, xero-node
  • No credentials in code. Everything is read from environment variables (see .env.example)
  • Input validated at the edges, no stack traces sent to clients, path-traversal and XSS guards where relevant

Quick start

nvm use                       # Node 24
npm install
cp .env.example .env          # fill in what your example needs
node --env-file=.env web/express/app.js

Folders with their own package.json (the chat and WebRTC apps, the Passport apps in auth/, web/express-generator-app, and a few in stackoverflow_answers/) are installed and run from inside that folder.

Examples

Each top-level folder is one category.

payments/ — Stripe

apis/ — third-party HTTP APIs

Promises in loops · Error handling · finally · Deep copy a directory · AES-256-GCM encryption · Nested plugin loading · Streaming XML · Resample WAV to 8 kHz · and more

One-liners and tips collected over the years.

Development

npm run lint          # ESLint 10 with eslint-plugin-security
npm run format:check  # Prettier
npm test              # every example parses as ESM, uses no require(), and declares its imports

CI runs all of these on Node 22 and 24, plus npm audit and CodeQL. Dependabot keeps dependencies current.

Security

See SECURITY.md. These are teaching examples. Add authentication and review them before you deploy any of them.

License

ISC

About

⭐ Awesome Node Cheats

Resources

Security policy

Stars

423 stars

Watchers

23 watching

Forks

Releases

Packages

Used by

Contributors

Languages