parse-npm-tarball-url
Version:
Parse a tarball URL hosted in the npm registry
35 lines (22 loc) • 729 B
Markdown
[](https://travis-ci.org/pnpm/parse-npm-tarball-url)
> Parse a tarball URL hosted in the npm registry
```
<pnpm|yarn|npm> add parse-npm-tarball-url
```
```js
import parseNpmTarbalUrl from 'parse-npm-tarball-url'
const pkg = parseNpmTarbalUrl('http://registry.npmjs.org/foo/-/foo-1.0.0.tgz')
console.log(pkg)
// {
// host: 'registry.npmjs.org',
// name: 'foo',
// version: '1.0.0'
// }
```
- [get-npm-tarball-url](https://github.com/pnpm/get-npm-tarball-url) - Create the tarball URL of a npm package
[](LICENSE) © [Zoltan Kochan](https://www.kochan.io)