projectのpackage.jsonを作る

[vagrant@localhost front]$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sane defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install –save` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
name: (front) front
version: (0.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (BSD)
About to write to /home/vagrant/local/front/package.json:

{
“name”: “front”,
“version”: “0.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“test”: “echo \”Error: no test specified\” && exit 1″
},
“author”: “”,
“license”: “BSD”
}

Is this ok? (yes)

[vagrant@localhost front]$ ls
package.json

package.jsonが入りました。中身を観ると、コマンドラインと一緒ですね。

{
  "name": "front",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "BSD"
}