Discussion


Any time we depend on code from other projects (will be often), we need to provide a "package.json" file. It is also needed for publishing our code.

For stand-alone projects, "package.json" is not strictly needed, but it is good to have anyway (for muscle memory practice).

Minimal 'package.json' file
{
  "name" : "myproject",
  "version" : "0.0.0"
}
Example 'package.json' file
{
  "name": "web-server",
  "version": "1.0.0",
  "description": "",
  "main": "helloworld-webserver.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "Foo <foo@abc.com>",
  "license": "ISC",
  "dependencies": {
    "http-status-codes": "^2.1.4"
  }
}


References



By default, npm commits to the public registry.
https://registry.npmjs.org

By default, npm commits to the public registry: https://registry.npmjs.org.