Choosing an IDE
NodeJS package manager
The NodeJS package manager is npm. npm can install modules globally and locally. Supporting tools like 'mocha' for testing and 'typings' for TypeScript support are good candidates to install globally. Do keep track though of your globally installed modules since if you want to reproduce your environment somewhere else, these modules could be dependencies (especially in your build process). You can configure local dependencies in a package.json file. When you do a 'npm install', modules mentioned in that file are installed locally in the node_modules folder of your project. If you want to also update the package.json, you can do 'npm install --save'. This allows you to easily update versions of modules. When your node_modules directory is corrupt because you for example interrupted a module download, you can just remove the node_modules directory and rebuild it from the package.json file.
Next to the tsd files, you need to provide Visual Studio Code with compiler options in a jsconfig.json file.
The result looks like:
Below some sample test code
Below what happens when you run Mocha.
For testing as a true outside client, you can use Ready-API or for example Postman, Postman is a Chrome plugin.
In order to debug your project and run NodeJS from Visual Studio Code, you need to provide a launch.json file in . vscode directory.
Some general observations
A NodeJS instance uses a single thread. Therefore, you should strife to have all your code non-blocking. Most functions support asynchronous interaction. This allows you to perform an action and wait for an asynchronous callback. While 'waiting' for the callback, other actions can be performed and other callbacks can be received. This event driven / asynchronous way of programming is something you have to get used to. Scalability can be increased by raising more NodeJS instances. In accordance with Microservices architecture, services should be stateless. My example cache process is not stateless and does will not scale well. Instead of using a local variable I should have used a persistent store.
NodeJS and Oracle
Oracle is of course also investing in NodeJS. There is the Application Container Cloud Service which allows you to run NodeJS applications. You can choose the version of NodeJS on which your application should run. This allows Oracle to (relatively easily) stay up to date with the cloud service and users to choose when to run on which version. The cloud service comes integrated with an Oracle database driver to easily access your Oracle persistent store.
Also NodeJS is used in Mobile Cloud Service under the hood.
Oracle is working on several products which go well with NodeJS such as the API Platform and most likely more is coming in this area.
If you want to know how you can access the Oracle database from NodeJS, look here. If you want to create a Docker container with NodeJS and the Oracle database driver integrated, see here.
NodeJS for orchestration
Some things I have not looked at
For test coverage reporting you also need specific tools. See here for some example modules. Istanbul seems popular when using Mocha.