Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.15.3.17
var argv = process.argv
if (argv.length < 3) {
console.error('Usage: read-package.json <file> [<fields> ...]')
process.exit(1)
}
var file = argv[2]
var readJson = require('read-package-json')
readJson(file, function (er, data) {
if (er) throw er
if (argv.length === 3) {
console.log(data)
} else {
argv.slice(3).forEach(function (field) {
field = field.split('.')
var val = data
field.forEach(function (f) {
val = val[f]
})
console.log(val)
})
}
})
|