How to use the @pnpm/tarball-fetcher.default function in @pnpm/tarball-fetcher

To help you get started, we’ve selected a few @pnpm/tarball-fetcher examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / packages / tarball-fetcher / example / index.js View on Github external
'use strict'
const createFetcher = require('@pnpm/tarball-fetcher').default

process.chdir(__dirname)

const registry = 'https://registry.npmjs.org/'
const fetch = createFetcher({
  registry,
  rawConfig: {
    registry,
  },
})

const resolution = {
  tarball: 'https://registry.npmjs.org/is-positive/-/is-positive-1.0.0.tgz',
}
fetch.tarball(resolution, 'dist/unpacked', {
  cachedTarballLocation: 'dist/cache.tgz',
  prefix: process.cwd(),
})
.then(index => console.log(Object.keys(index)))
.catch(err => {
  console.error(err)
github pnpm / pnpm / packages / server / example / server.js View on Github external
async function main() {
  const registry = 'https://registry.npmjs.org/'
  const rawConfig = { registry }
  const store = '.store'
  const resolve = createResolver({
    rawConfig,
    store,
    metaCache: new Map(),
  })
  const fetchers = createFetcher({
    alwaysAuth: true,
    registry,
    strictSsl: true,
    rawConfig,
  })
  const storeCtrl = await createStore(resolve, fetchers, {
    networkConcurrency: 1,
    store,
  })

  const port = 5813
  const hostname = '127.0.0.1';
  const server = createServer(storeCtrl, {
    port,
    hostname,
  })

@pnpm/tarball-fetcher

Fetcher for packages hosted as tarballs

MIT
Latest version published 9 days ago

Package Health Score

57 / 100
Full package analysis

Popular @pnpm/tarball-fetcher functions