Deploying a module to npm
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: npm
.
Getting ready
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 the following code:
{ "author": "David Mark Clements <contact@davidmarkclements.com> (http://davidmarkclements.com)", "name": "mp3dat", "description": "A simple MP3 parser that returns stat infos in a similar style to fs.stat for MP3 files or streams. (MPEG-1 compatible only)", "version": "0.0.1", "homepage": "http://nodecookbook.com/mp3dat", "repository": { "type": "git", "url": "git://github.com/davidmarkclements/mp3dat.git" }, "main": "./lib/index.js", "scripts": { "test": "node test" }, "engines": { "node": "~0.6.13" }, "dependencies": {}, "devDependencies": {} }
We can of course insert our own name and the name of the package. Another way to create a package...