Skip to content

Search npm packages by web scraping and without indexing all npm packages

License

Notifications You must be signed in to change notification settings

amovah/enpeem-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enpeem-search

Search npm packages by web scraping and without indexing all npm packages

Why should we use this module?

It's good question. I used npm module to search packages, but npm first must indexing all packages then search. some of developers have problem with npm search. So I made a decision to create a module to search package without indexing all package. I use web scraping and site search to search packages.

Example

First install the module : npm install enpeem-search. then :

import search from 'eneepm-search';

search('yo', 1, 2).then((result) => {
  console.log(result);
});

/* result
[ { name: 'yo-api-wrapper',
    author: 'hinderberg',
    description: 'Yo api wrapper for nodejs',
    stars: '1',
    version: '0.0.1',
    url: 'https://www.npmjs.com/package/yo-api-wrapper' } ]
*/

search('some-thing-every-thing', 2).catch(() => {
  console.log('Not found'); //'Not found'
})

Usage

search(query [,limit] [,skip])

query

type: String

required: Yes

The search query.

limit

type: Number

required: No

default: 1

Limit result from 1 to 20.

skip

type: Number

required: No

default: 0

Skip the first n results.

result

enpeem-search returns a Promise.

result is a Array that includes result as Object.

Object has:

  1. name: name of the package
  2. author: author of the package
  3. description: description of the package
  4. stars: stars of the package
  5. version: version of the package
  6. url: URL of the package

Contributing, Idea, Issue

Feel free to fill an issue or create a pull request, I'll check it ASAP.

Just don't forgot build your code:

gulp build

LICENSE

MIT

About

Search npm packages by web scraping and without indexing all npm packages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published