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.
E.g.
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.jsonand 2, check formain_module_dir/../package.json.