An open API service indexing awesome lists of open source software.

https://github.com/pnpm/parse-npm-tarball-url

Parse a tarball URL hosted in the npm registry
https://github.com/pnpm/parse-npm-tarball-url

npm registry

Last synced: 2 months ago
JSON representation

Parse a tarball URL hosted in the npm registry

Awesome Lists containing this project

README

        

# parse-npm-tarball-url

[![Build Status](https://travis-ci.org/pnpm/parse-npm-tarball-url.svg?branch=master)](https://travis-ci.org/pnpm/parse-npm-tarball-url)

> Parse a tarball URL hosted in the npm registry

## Installation

```
add parse-npm-tarball-url
```

## Usage

```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'
// }
```

## Related

- [get-npm-tarball-url](https://github.com/pnpm/get-npm-tarball-url) - Create the tarball URL of a npm package

## License

[MIT](LICENSE) © [Zoltan Kochan](https://www.kochan.io)