How to use the @pnpm/npm-resolver.default function in @pnpm/npm-resolver

To help you get started, we’ve selected a few @pnpm/npm-resolver 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 / npm-resolver / example.js View on Github external
'use strict'
const createResolveFromNpm = require('@pnpm/npm-resolver').default

const resolveFromNpm = createResolveFromNpm({
  metaCache: new Map(),
  store: '.store',
  offline: false,
  rawConfig: {
    registry: 'https://registry.npmjs.org/',
  },
})

resolveFromNpm({alias: 'is-positive', pref: '1.0.0'}, {
  registry: 'https://registry.npmjs.org/',
})
.then(resolveResult => console.log(JSON.stringify(resolveResult, null, 2)))
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

@pnpm/npm-resolver

Resolver for npm-hosted packages

MIT
Latest version published 7 days ago

Package Health Score

66 / 100
Full package analysis