Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'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)))
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