Shawn Mervin

Node

JavaScript on the server: the API, the chat server and the functions behind this site.

Visit nodejs.orgBehind it

What it is

Node.js is a JavaScript runtime built on Google's V8 engine. It lets JavaScript run outside the browser, on servers, in command-line tools and in serverless functions. Ryan Dahl created it, and it is now part of the OpenJS Foundation. It is one of the standard runtimes on AWS Lambda and most other cloud platforms.

Node handles input and output with an event loop rather than a thread per request, so one process can hold many open connections at once. That suits APIs, WebSocket servers and streaming responses. Its package registry, npm, is one of the largest software ecosystems there is, which means most common problems already have a maintained library.

How I use it

  • Rental Pilot's real-time chat server and push notifications run on Node on EC2.
  • Lend Pilot's API is Node and Express, with PostgreSQL, in Docker Compose behind nginx.
  • The five Lambda functions behind this site run on Node 22 on Graviton.
  • One of them is the agent on the ask page, a streaming Lambda function that calls Claude on Amazon Bedrock.

Node is the right tool for APIs and anything that holds many connections open, like chat or streaming responses. I use it because the same language then runs from the browser to the server, and because it is a first-class runtime on Lambda.

Questions

Do you build APIs in Node?

Yes. Rental Pilot's API is PHP, with a Node server for real-time chat and push notifications. Lend Pilot's API is Node and Express with PostgreSQL.

Can Node run serverless?

Yes. Every dynamic feature on this site is a Node 22 Lambda function behind CloudFront, including the agent that answers questions.

Working with Node?

Tell me what you're building. Start a project or see the whole stack.

Got an operation that's outgrown its spreadsheets?

Tell me what your business does and where it's jamming up. If I'm not the right person for it, I'll say so and point you somewhere better.

What to send, and what happens next