O'Reilly logo

Node Cookbook Second Edition by David Mark Clements

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deploying a module to npm

npm is the official package manager for Node. When we deploy a module to npm, we are uploading it to the official npm repository (which happens to be a CouchDB database).

Now that we've created a module, we can share it with the rest of the world using the same integrated tool that we retrieve modules with; that is, npm.

Getting ready

Building on the final state of mp3dat from the previous recipe, Extending a module's API (including all the changes we made in the There's More… section so that we can accept streams or filenames via the same stat method and our module also emits events), we'll make sure this canonical mp3dat is in a directory called mp3dat.

Before we can deploy to npm, we need to make a package.json file; so, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required