Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example with View doesn't work #13

Open
metronom72 opened this issue Jul 5, 2020 · 1 comment
Open

Example with View doesn't work #13

metronom72 opened this issue Jul 5, 2020 · 1 comment
Labels

Comments

@metronom72
Copy link

metronom72 commented Jul 5, 2020

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.

@Hypnosphi Hypnosphi mentioned this issue Aug 25, 2020
@doowb doowb added the bug label Aug 25, 2020
@doowb
Copy link
Owner

doowb commented Aug 25, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants