Open yipo opened 8 years ago
npm init [--yes|-y]
to create a prototype of package.json.
name
: all-lowercase (See how other projects are named.)version
: major.minor.patch (See semver and npm.)description
keywords
homepage
bugs
repository
For a project on GitHub (foo/bar, for example), it should be as follows.
{ "homepage": "https://github.com/foo/bar", "bugs": { "url": "https://github.com/foo/bar/issues" }, "repository": { "type": "git", "url": "https://github.com/foo/bar.git" } }
license
: a SPDX license ID, such as MIT
for MIT License. (more details)author
: one person.contributors
: an array of persons.A person can be an object,
{ "name": "Foo Bar", "email": "foo@bar.com", "url": "http://foo.bar.com/" }
or simply a string in the following format.
"Foo Bar <foo@bar.com> (http://foo.bar.com/)"
Both email and URL are optional either way.
main
: the entry point, index.js
by default.scripts
: automation and continuous integration, see npm-scripts.dependencies
: add an entry by npm install foobar --save
.devDependencies
: add an entry by npm install foobar --save-dev
.
So that all the dependencies required by the application can be simply installed by
npm install
(aselectron/electron-quick-start
does for example).Reference