-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Take -version from package.json #48
Copy link
Copy link
Closed
Description
E.g.
program.version(JSON.parse(require('fs').readFileSync(
require.main.filename.match(/^(.+)\/.+$/)[1] + '/../package.json')).version)But a test is needed for the existence of package.json, I think the 2 most used locations are and /.
So 1, check for main_module_dir/package.json and 2, check for main_module_dir/../package.json.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels