npm-indexer

0.1.0 • Public • Published

npm-indexer NPM version NPM monthly downloads NPM total downloads Linux Build Status

Index NPM packages based on package.json information.

Install

Install with npm:

$ npm install --save npm-indexer

Usage

var npmIndexer = require('npm-indexer');

API

npmIndexer

Create a stream of matching npm packages. Use the provided indexer to collect and index the matching npm packages to create search indexes.

Params

  • options {Object}: Options specifying the indexer to use and additional options for the changes stream.
  • options.indexer {Object}: Specify the indexer to use for creating a search index. Example: search-indexer-algolia.
  • options.includeName {Boolean}: Include the package name when determining if the package should be indexed. Defaults to false.
  • options.keywords {Array}: Array of keywords to use to determine if the package should be indexed. These are matched against the package keywords and the package name if includeName is true.
  • options.since {Number}: Sequence number passed to changes stream that will indicate which sequence number to start with.
  • options.limit {Number}: Limit the number of packages returned from the changes stream. Defaults to -1 which will be continuous.
  • options.db {String}: CouchDB URI to pull the changes stream from. Defaults to the NPM registry.
  • returns {Stream}: Returns a stream that will have matching packages.

Example

npmIndexer({
  indexer: require('search-indexer-algolia')(algoliaOptions),
  keywords: ['assembleplugin']
})
.on('data', console.log)
.on('end', console.log.bind(console, 'done'));

About

Related projects

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Brian Woodward

License

Copyright © 2017, Brian Woodward. Released under the MIT License.


This file was generated by verb-generate-readme, v0.4.3, on April 05, 2017.

Package Sidebar

Install

npm i npm-indexer

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • doowb