Open metronom72 opened 4 years ago
The next code doesn't work. It mostly from the example
import NpmApi from 'npm-api'; export const search = async (query) => { try { const npm = new NpmApi(); debugger; let view = npm.view('listAll'); let pkg = await view.query({ // group_level: 4, startkey: JSON.stringify(['react']), endkey: JSON.stringify(['react', {}]) }); debugger if (pkg.length > 0) { let val = pkg[0].value; let latest = val.versions[val['dist-tags'].latest]; } debugger } catch (err) { console.log(err); throw err; } }
I know that package react ixists, but code upper there shows that such package doesn't exist.
Sorry, I missed this before. NPM has made some changes and I think I'll need to make updates to the .view and .list methods. I might not be able to keep those in here.
.view
.list
The next code doesn't work. It mostly from the example
I know that package react ixists, but code upper there shows that such package doesn't exist.