GithubHelp home page GithubHelp logo

isabella232 / npm-search-pagelet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nodejitsu/npm-search-pagelet

0.0 0.0 0.0 2.98 MB

Search the npm registry.

License: MIT License

JavaScript 89.62% CSS 10.38%

npm-search-pagelet's Introduction

npm-search-pagelet

A really simple search box/auto-complete for npm modules. Great to be used in conjunction with our package-pagelet and npm-dependencies-pagelet.

Installation

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.

Configuration

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 expirable module with an expiration of 1 hour.
  • 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 npm-search-pagelet

module.exports = require('npm-search-pagelet').extend({
  max: 10 // only show 10 items
});

You can see a working version of this pagelet on: http://browsenpm.org/

npm-search-pagelet's People

Contributors

3rd-eden avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.