Reference > https://docs.npmjs.com/cli/configuring-npm/package-json
Examples:
{
"//": [
"A comment",
"Another comment"
],
"name": "@edu.cou/app_comp",
"version": "24.10.9-alpha.3",
"scripts": {
"test": "jest"
},
...
"devDependencies": {
"jest": "^29.7.0"
}
}
Reference > https://stackoverflow.com/a/63112599/1323562
Examples:
"version": "1.8.8"
"version": "2.0.0-alpha.0"
"version": "2.0.0-beta.0"
The "//" key will never be used by npm for any purpose, and is reserved for comments.
If you want to use a multiple line comment, you can use either an array, or multiple "//" keys.
When using your usual tools (npm, yarn, etc.), multiple "//" keys will be removed.
One must be aware that "//" can only be used at the root of the package.json object.
{
"//": [
"first line",
"second line"
]
}
{
"//": "this is the first line of a comment",
"//": "this is the second line of the comment"
}
--save flag adds it to the package.json as a dependency.
--save-dev flag adds it to package.json as a development dependency.
a) Install dependencies from package.json
npm install
b) Installs a package, eg 'uuid'.
npm install --save uuid
b) Installs a development package, eg 'caniuse-lite'.
npm install --save-dev caniuse-lite