#251
New
talk about this packge.json tip
Reported by Volkan Ozcelik on JavaScript: from Zero to Hero · 22/07/2018 21:36:05
- Assigned to:
- Volkan Ozcelik
- Priority:
- Normal
- Status:
- New
- Category:
- Lessons
- Version:
- None
Woah, just learned that in Node, values in package.json are automatically accessible like this:
process.env.npm_package_keyYouWantHere
For example, if you want to read the version key from package.json in your Node script, do this:
process.env.npm_package_version
Attachments
No attachment has been uploaded, yet.
Loading comments...