Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/amovah/enpeem-search

Search npm packages by web scraping and without indexing all npm packages
https://github.com/amovah/enpeem-search

Last synced: about 1 month ago
JSON representation

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

Lists

README

        

# 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 :

```javascript
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](https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/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](http://mit-license.org/)