Wether you are just getting started writing your first Node.js application or you are a front end developer looping to do some automation, NPM can help you manage your dependencies. To play with the commands I am going to list in this article you just need to have node.js installed. Luckily for us that is so super simple now days that I am just gonna grab a drink of coffee while you download and install it from the Node.js downloads page.
Every project starts with package.json If for not other reason that you will write a description of why you even started it. But luckily for us NPM will actually walk us through setting up our package.json by asking us some general questions. From the root directory of our application running the init command of npm will get a guided setup.
entry point: (index.js)
About to write to /Users/simeon/Desktop/dunno/package.json:
“description”: “ERROR: No README.md file found!”,
“test”: “echo “Error: no test specified” && exit 1″
Is this ok? (yes)
Note in the code above “dunno” happens to be the folder name that the the `npm init` command was run from.