I found these properties prefixing underscore in package.json. What are they used for? why prefixing underscore on properties?
"_from": "[email protected]",
"_id": "[email protected]",
"_inCache": true,
"_location": "/react-scripts",
"_nodeVersion": "6.0.0",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/react-scripts-0.9.3.tgz_1488303928068_0.6415497597772628"
},
"_npmUser": {
"name": "gaearon",
"email": "[email protected]"
},
The main property of a package. json is a direction to the entry point to the module that the package. json is describing. In a Node. js application, when the module is called via a require statement, the module's exports from the file named in the main property will be what's returned to the Node.
keywords. Put keywords in it. It's an array of strings. This helps people discover your package as it's listed in npm search .
The goal of package-lock. json file is to keep track of the exact version of every package that is installed so that a product is 100% reproducible in the same way even if packages are updated by their maintainers. This solves a very specific problem that package.
Those are meta data reserved for package registries. All properties beginning with _ or $ are reserved for package registries to use at their discretion. wiki common "Reserved Properties" section explains it.
Underscore is the reserved property of package.json, it is used for reserved keys. So, it is clearly mentioned in Documentation of package.json , we can't start a name with an underscore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With