BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Node Package Manager

| by Alex Blewitt Follow 2 Followers on Jun 17, 2011. Estimated reading time: 1 minute |

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

Adoption Stage
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

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT