Starting projects with npm
For Node.js projects, the settings and configurations are stored inside a file named package.json, located at the root of the repository. The npm CLI tool provides a npm init command, which will initiate a mini-wizard that helps you compose your package.json file. So, inside our project directory, run npm init to initiate the wizard.Â
The wizard will ask you a series of questions, but also provides sensible defaults. Let's go through each question one by one:
package name: We are happy with the default name ofhobnob(derived from the directory name), so we can just press theReturnkey to continue.version: We're going to follow semantic versioning (semver) here and use major version 0(0.y.z) to indicate that our code base is under initial development, and that the API is not stable. Semver also recommends that our initial release be0.1.0.
description: A brief description of your project; if we make our application public on npmjs.com, this description will appear...