Files
pnpm/example.js
2017-11-28 00:09:49 +02:00

18 lines
438 B
JavaScript

'use strict'
const got = require('got')
const resolveFromNpm = require('@pnpm/npm-resolver').default
resolveFromNpm({alias: 'is-positive', pref: '1.0.0'}, {
storePath: '.store',
registry: 'https://registry.npmjs.org/',
metaCache: new Map(),
offline: false,
getJson,
})
.then(resolveResult => console.log(resolveResult))
function getJson (url, registry) {
return got(url, {json: true})
.then(response => response.body)
}