npm package.json basic file structure/example

In case you ever need a basic npm package.json file, here is a basic skeleton you can use:

{
  "name": "Demo App",
  "version": "1.0.0",
  "description": "Demo app by @jahller",
  "main": "index.html",
  "dependencies": {
    "bootstrap": "3.3.6"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jahller/tictactoe.git"
  },
  "author": "Jan Heller - @jahller",
  "license": "UNLICENSED",
  "bugs": {
    "url": "https://github.com/jahller/tictactoe/issues"
  },
  "homepage": "https://github.com/jahller/tictactoe#readme"
}

The same can also be achieved by running the command npm init in your project folder.
This will start an interactive prompt with questions that will result in the output of a package.json in your project folder.

Leave a Reply

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