npm (Node Package Manager) is a package manager for JavaScript, commonly used with Node.js.
npm allows developers to share and reuse code, as well as manage project dependencies.
Here’s how npm works on the IBM i system:
Installation
To use npm on IBM i, you first need to install Node.js. This can be done through the IBM i Open Source Solutions (5733OPS) licensed program1. Once Node.js is installed, npm is typically included by default.
Key Features
Usage on IBM i
Installing Packages: You can install packages from the npm registry using the npm install
command.
For example, to install the express
package, you would run:
Running Scripts: Define scripts in your package.json
file and run them using npm run
.
For example, to start your application, you might have a script like:
"start": "node app.js"
}
You can then run it with:
Accessing IBM i Resources:
There are npm packages specifically designed to interact with IBM i resources.
For example, the itoolkit package allows you to call RPG, CL, and other IBM i programs2.