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, let's do that for our module. In mp3dat
, we'll create package.json
and add some information (of course, we can always customize to whatever details work for us):
{ "author": "David Mark Clements <contact@davidmarkclements.com> (http://davidmarkclements...