9951 explained code solutions for 126 technologies


nodejsHow to init Node.js project with NPM


mkdir mynode && cd mynode
npm init --yesctrl + c
npm

Node.js package manager

init

inits new package configuration

mynode

new project directory name


Usage example

mkdir mynode && cd mynode
npm init --yes
cat package.json
output
{
  "name": "mynode",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

Related