npm

npm

The Node Package Manager is a command line javascript package manager. It is powerful if you use build tools like gulp or if you develop server side with javascript.

The setup is simple:

place a package.json in your project folder

{
  "name": "project-name",
  "version": "0.1.0",
  "description": "project-name is a project which gets things done!",
  "repository": {
    "type": "git",
    "url": "git://url.com/username/repo.git"
  },
  "keywords": [
    "project keywords", "another keyword"
  ],
  "author": "Florian Moser <me@myurl.ch>",
  "license": "MIT",
  "bugs": {
    "url": "https://url.com/username/repo/issues"
  },
  "homepage": "https://url.com/username/repo",
  "devDependencies": {
    "gulp": "^3.9.1"
  }
}

Let npm do its magic

npm install

This will download / actualize all dependencies specified in the devDependencies or dependencies node.

Some other useful commands

npm install <package_name>

Install the package into the current directory. Append the flag --save or --save-dev to put the package into your dependencies.

You can download the tool from here.

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *