# npm-package-info

> fetches the package information for an npm package

Latest version **0.1.0** (published 2019-04-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install npm-package-info
pnpm add npm-package-info
yarn add npm-package-info
bun add npm-package-info
```

Provides the command `npm-package`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-04-23 |
| First published | 2015-12-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jesse Ditson |
| Maintainers | jesseditson |
| Keywords | npm, package |

## Links

- npm: https://www.npmjs.com/package/npm-package-info
- Repository: https://github.com/jesseditson/npm-package
- Homepage: https://github.com/jesseditson/npm-package#readme
- Issues: https://github.com/jesseditson/npm-package/issues
- npm.io page: https://npm.io/package/npm-package-info

## Dependencies (4)

- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [superagent](https://npm.io/package/superagent.md) ^3.7.0
- [registry-url](https://npm.io/package/registry-url.md) ^3.0.3
- [realize-package-specifier](https://npm.io/package/realize-package-specifier.md) ^3.0.1

## Recent versions

- 0.1.0 (latest) — 2019-04-23
- 0.0.5 — 2018-07-09
- 0.0.3 — 2015-12-17
- 0.0.2 — 2015-12-17
- 0.0.1 — 2015-12-17

## README

# npm-package
fetches the package information for an npm package


# Usage

`npm install --save npm-package-info`

or

`npm install -g npm-package-info`

**node module**

```javascript
var npmPackage = require('npm-package-info')

// get a public package
npmPackage('package-name', function(err, pkg) {
  // pkg is an object containing the contents of package.json
})

// get a private github package
npmPackage('user/repo', { token: 'githubtoken' }, function(err, pkg) {
  // same as above
})
```

**command line**

```
# public
$ npm-package package-name
# private
$ npm-package --token githubtoken package-name
# both above commands output pretty printed json to stdout

# disable pretty-printing (print json all on one line)
$ npm-package --raw package-name
```

**generating a github token**

The tokens used above are for accessing private github content via the API. You can find out how to generate a github token here:

[https://help.github.com/articles/creating-an-access-token-for-command-line-use/](https://help.github.com/articles/creating-an-access-token-for-command-line-use/)

**FAQ**

- Does this work with private npm hosts?

I dunno, but probably. I don't currently use private npm packages or self hosted npm, so testing and reporting issues in this area would be appreciated!

- Does this work with <special type of npm package definition>?

Probably! This uses the same resolver as npm core, so in theory it should be able to resolve anything npm can resolve, including version numbers and tags. That being said, if you find something that doesn't work, please file an issue so I can fix it.

---
_Source: https://npm.io/package/npm-package-info · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
