https://nodejs.org/en/knowledge/getting-started/npm/what-is-the-file-package-json/
All npm packages contain a file, usually in the project root, called package.json
this file holds various meta data relevant to the project.
this file is used to give information to npm that allows it to identify the project as well as handel the project's dependencies.
WHEN AND HOW IS IT CREATED?
https://docs.npmjs.com/cli/init
npm-init creates 'package.json' file.
*ADDITIONAL INFO - NPX *
All npm packages contain a file, usually in the project root, called package.json
this file holds various meta data relevant to the project.
this file is used to give information to npm that allows it to identify the project as well as handel the project's dependencies.
WHEN AND HOW IS IT CREATED?
https://docs.npmjs.com/cli/init
npm-init creates 'package.json' file.
*ADDITIONAL INFO - NPX *
npm init <initializer>
can be used to set up a new or existing npm package.initializer
in this case is an npm package named create-<initializer>
, which will be installed by
npx
, and then have its main bin executed – presumably creating or updating package.json
and running any other initialization-related operations.
The init command is transformed to a corresponding
npx
operation as follows:npm init foo
->npx create-foo
npm init @usr/foo
->npx @usr/create-foo
npm init @usr
->npx @usr/create
Any additional options will be passed directly to the command, so
npm init foo --hello
will map to npx create-foo --hello
.
댓글
댓글 쓰기