Giter Club home page Giter Club logo

npm-keyword's Issues

`.count` crashes for a non-existent keyword

Hi, while working at b12-archive/keyword-popularity#1 I noticed that npmKeyword.count() chokes on a keyword that doesn’t exist.

Here’s what my REPL shouts:

npmKeyword.count('äąâ')
// …after a while:
TypeError: Cannot read property 'value' of undefined
    at /node_modules/npm-keyword/index.js:64:19
    at /node_modules/npm-keyword/index.js:24:3
    at /node_modules/npm-keyword/node_modules/got/index.js:99:4
    at BufferStream.<anonymous> (/node_modules/npm-keyword/node_modules/got/node_modules/read-all-stream/index.js:64:3)
    at BufferStream.emit (events.js:129:20)
    at finishMaybe (/node_modules/npm-keyword/node_modules/got/node_modules/read-all-stream/node_modules/readable-stream/lib/_stream_writable.js:502:14)
    at afterWrite (/node_modules/npm-keyword/node_modules/got/node_modules/read-all-stream/node_modules/readable-stream/lib/_stream_writable.js:381:3)
    at afterTick (/node_modules/npm-keyword/node_modules/got/node_modules/read-all-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js:11:8)
    at process._tickDomainCallback (node.js:381:11)

Need to update search endpoint

Hej,

the endpoint used by that module is returning timeout errors frequently and will be probably be retired soon.

This is the feedback I got from npm support regarding yeoman/yo#544.

Thanks for reaching out. I've reached out to our team. They are in the process of retiring all endpoints as there are performance issues and timeouts. Per our team, you could run the below curl command instead:

curl -XGET https://registry.npmjs.org/-/v1/search?text=keywords:yeoman-generator | json

For more information on the new search API, please go to:
https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-v1search

Please let us know if there is anything else we can do for you. We’ll be here to help. Thank you.

Problem with the new endpoint is that the result set is limited to a maximum of 250 😞
That means for getting all yeoman generators (6984) we would need to call that endpoint almost 30 times 🙀

Maybe the npms.io API offers an alternative endpoint to get all results with just one request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.