A RESTful API wrapper for the npm module (useful for mobile clients)

npm install rest-npm
10 downloads in the last month


npm install rest-npm


rest-npm takes two parameters. A port to run on, and an object that defines what commands the API will accept as well as the number of arguments each one requires.

var restNpm = require('rest-npm')

// Configure with port and valid commands
restNpm.start(3000, {
  // view command accepts between 1 and 5 params
  view: [ 1, 5 ],

  // search command accepts 1 and only 1 param
  search: 1

Query Structure

The query structure is very simple. I wanted to mirror the npm cli interface as close as possible so the structure is very generic.

# Basic structure

# Sample search query
#  npm search blog

# View module name, description and version
#  npm view express name description version


  • Write unit tests
  • Better error handling
npm loves you