To see information about a JS package, there’s npm-view command.

For example, to see a current version of Dotenv, I can use:

$ npm view dotenv version
16.0.2

I can also use info, show, or v instead of view.

To see all dependencies:

$ npm info dotenv dependencies

To see more info, I don’t need to specify anything else besides the package name:

$ npm info dotenvdotenv@16.0.2 | BSD-2-Clause | deps: none | versions: 68
Loads environment variables from .env file
https://github.com/motdotla/dotenv#readme
keywords: dotenv, env, .env, environment, variables, config, settingsdist
.tarball: https://registry.npmjs.org/dotenv/-/dotenv-16.0.2.tgz
.shasum: 0b0f8652c016a3858ef795024508cddc4bffc5bf
.integrity: sha512-JvpYKUmzQhYoIFgK2MOnF3bciIZoItIIoryihy0rIA+H4Jy0FmgyKYAHCTN98P5ybGSJcIFbh6QKeJdtZd1qhA==
.unpackedSize: 34.8 kB
maintainers:
- ~jcblw <jacoblowe2.0@gmail.com>
- scottmotte <scott@scottmotte.com>
- motdotla <mot@mot.la>
dist-tags:
latest: 16.0.2
published 2 weeks ago by motdotla <mot@mot.la>

npm-viewcan be sometimes useful in scripts that automate something, so it’s good to know about the command.

--

--