BT
x Share your thoughts on trends and content!

Node Package Manager

by 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.

Rate this Article

Relevance
Style

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
General Feedback
Bugs
Advertising
Editorial
Marketing
InfoQ.com and all content copyright © 2006-2016 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.