Objective
How to download a tarball file for the Node agent.
Process
- Run
npm view @contrast/agent dist.tarball
- That command will generate a URL you can paste in a browser to download the tgz file of the <latest> Node.js agent
For example:❯ npm view @contrast/agent dist.tarball
https://registry.npmjs.org/@contrast/agent/-/agent-4.24.2.tgz
Alternate approach
If you need to get the tarball without having npm
installed, you can fetch the package information using curl
and jq
to get the right information from the JSON. This is for instance useful if you're building a Docker container that requires one npm package, and you don't want to install npm
just for that.
curl https://registry.npmjs.org/PACKAGE-NAME/ \ | jq '.versions[."dist-tags".latest].dist.tarball'
For example:
❯ curl https://registry.npmjs.org/@contrast/agent/ | jq '.versions[."dist-tags".latest].dist.tarball'
"https://registry.npmjs.org/@contrast/agent/-/agent-4.24.2.tgz"