Previous: Package Fields, Up: Creating a packagejson File [Index]
You can create a package.json file by running a CLI questionnaire or creating
a default package.json file.
To create a package.json file with values that you supply, use the npm
init command. Run the following command from the root directory of your
package and answer the questions.
npm init
package.json FileTo create a default package.json using information extracted from the
current directory, use the npm init command with the ‘--yes’ or ‘-y’ flag.
npm init --yes