BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Node Package Manager

by Alex Blewitt on Jun 17, 2011 |

Since its 1.0 release last month, the Node Package Manager has had a number of point revisions and is being increasingly used to manage Node.js runtimes.

With its deceptively simple one-line install (curl http://npmjs.org/install.sh | sh), provided that Node.js is already installed on the system. This allows you to acquire further Node packages using npm install, much like Python's easy_install or Perl's CPAN.

Node packages are represented as package.json files. The self-documenting npm help json gives the documentation (at https://github.com/isaacs/npm/blob/master/doc/json.md) gives a list of what's required, but includes:

  • name: something descriptive, and will be part of the URL and command line invocations (see the Npm Registry for examples)
  • version: based on semantic versioning, but permits versions to start with a v and to treat anything with a dash as unreleased code (so that git describe can be used to version contents easily)
  • description: short descriptive text, suitable for presenting to a user or searching
  • keywords: for search optimisation
  • homepage: the human-viewable website
  • url: location of package if it's not the same location as the package.json
  • main: the object to be returned at startup
  • files: the files as part of this package
  • repository: the location and type of where to access the sources or to contribute bug fixes
  • config: a set of parameters which can be acquired by your code, as well as overridden in the command with node config set

Node package manager is available on http://github.com/isaacs/npm for those that want to refer to the Readme or to fork the code.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT