Search for packages
A really simple search box/auto-complete for npm modules. Great to be used in
conjunction with our
This package is released in the public npm registry and can be installed using:
npm install --save npm-search-pagelet
Please note that this module should be used together with the BigPipe framework.
There are various of options that can be configured in the pagelet.
- cache: A synchronous cache instance that is used to store the looked up
package names and descriptions. This currently defaults to the
expirablemodule with an expiration of
- max: The maximum amount of items that we should send the client. This defaults to 50.
- save: A boolean indicating if we should store the remotely fetched package data locally. This is used as backup for when the upstream source is unavailable.
- url: The location of the list of package names + descriptions. We assume it's a file that contains an array with objects with a name and description properties.
These options should be set when you're extending the
moduleexports = require'npm-search-pagelet'extendmax: 10 // only show 10 items;
You can see a working version of this pagelet on: http://browsenpm.org/