npm

The package manager for JavaScript projects

About

npm installs JavaScript libraries and command-line tools from its registry. It records what a project depends on. Use it on a Node project, or to fetch a published utility.

Install it

pkg install nodejs-lts

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

npm install express Add a library to the current project and record it in the manifest.
npm install -g typescript Install a package globally, so its command works anywhere in the terminal.
npm init -y Create a project manifest with default answers. The starting point for a new project.
npm list Show the dependency tree of the current project.
npm update Bring installed packages up to the newest versions the manifest allows.
npm run build Run a named script defined in the project manifest.

Worked example

Run npm install express and this is what you should see.

termux
$ npm install express
added 57 packages, and audited 58 packages in 3s

10 packages are looking for funding

found 0 vulnerabilities

The count includes every transitive dependency.

Developed by

The npm project .