Node.js

REVIEW

Here’s a list of our preferred technology choices when implementing in Node.js. We’re not prescriptive in these choices, but have a good reason to deviate from the norm. If you there’s a better option, raise it at the Developer Community.

Node.js versions

Refer to the Release adoption schedule

Node projects must:

  • use NVM to manage Node versions in development
  • use an .nvmrc file, checked in to source control, to identify the Node version in use

IDE

Choose whatever you’re comfortable with, so as long as you can perform your
job. Our developers tend to use VS Code.

Build

  • Code coverage provided by Jest
  • Static analysis with SonarQube
  • Sass for CSS preprocessing and building CSS assets
  • Gulp is used for building clientside JavaScript assets
  • TypeScript can be used as a typesafe superset of JavaScript to provide more confidence
  • Prettier for opinionated code formatting

Application

Our standard JavaScript based application stack is built on Node.js.

Testing

  • Jest is our core testing framework
  • SuperTest is used to provide high level HTTP testing of web services
  • redis-mock for mocking of Redis in tests
  • ESLint to ensure we’re using JavaScript correctly

Improve the playbook

If you spot anything factually incorrect with this page or have ideas for improvement, please share your suggestions.

Before you start, you will need a GitHub account. Github is an open forum where we collect feedback.