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: 9 days ago
JSON representation
Search npm packages by web scraping and without indexing all npm packages
- Host: GitHub
- URL: https://github.com/amovah/enpeem-search
- Owner: amovah
- License: mit
- Created: 2015-07-05T14:08:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-17T15:37:04.000Z (almost 9 years ago)
- Last Synced: 2024-08-01T17:35:37.492Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-npm - enpeem-search - Search packages by scraping the npm web search. (Packages / Other)
- awesome-npm - enpeem-search - Search packages by scraping the npm web search. (Packages / Other)
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/)