A collection of tools and utilities for Node.js, maintained by the iTaaS team and used by various iTaaS projects.
Some of its features are designed to be generic enough for any Node.js project, while others are only suited for Express applications.
- Node.js v4+
Tip: use nvm to install and manage multiple versions of Node.js and npm
.
itaas-nodejs-tools
is not published on npm
, but you can install it straight from GitHub with the following command:
npm install --save git+https://github.com/agilecontent/itaas-nodejs-tools.git#VERSION
Replace VERSION
with the desired version from releases. The latest version is always recommended.
const tools = require('itaas-nodejs-tools');
const uuid = require('uuid').v4;
let callId = uuid();
let config = { key: "value" };
let logger = tools.createLogger();
let serviceLocator = tools.createServiceLocator();
let context = tools.createCallContext(callId, config, logger, serviceLocator);
Read the full docs here.
Developing on Linux is recommended, so you can run integration tests easily with Docker.
You can run all unit tests with this command:
npm run test-unit
To run all tests, including integration tests, use this command:
npm test
Debugging tests can be done with the following script:
npm run test-debug
It will enable Node.js debugger and make it listen on port 5858. You can then use Visual Studio Code or another editor to debug.
Everyone is free to open pull requests in this repository.
For more information on how to contribute properly, check these instructions.
These projects use iTaaS Node.js Tools: