Back to Pnpm

@pnpm/resolving.tarball-url

pnpm11/resolving/tarball-url/README.md

11.9.0759 B
Original Source

@pnpm/resolving.tarball-url

Build and recognize the canonical tarball URL of an npm package

<!--@shields('npm')-->

<!--/@-->

Installation

sh
pnpm add @pnpm/resolving.tarball-url

Usage

ts
import {
  getNpmTarballUrl,
  isCanonicalRegistryTarballUrl,
} from '@pnpm/resolving.tarball-url'

const registry = 'https://registry.npmjs.org/'

getNpmTarballUrl('foo', '1.0.0', { registry })
//=> 'https://registry.npmjs.org/foo/-/foo-1.0.0.tgz'

isCanonicalRegistryTarballUrl(
  'https://registry.npmjs.org/foo/-/foo-1.0.0.tgz',
  { name: 'foo', version: '1.0.0' },
  registry
)
//=> true

License

MIT