um-react/scripts/read_json.mjs
Jixun Wu bd85d0c37b
Some checks failed
continuous-integration/drone/push Build is failing
ci: avoid installing debian dependencies
2023-06-10 21:32:41 +01:00

13 lines
279 B
JavaScript
Executable File

#!/bin/env node
/* eslint-env node */
import fs from 'fs';
const data = JSON.parse(fs.readFileSync(0, 'utf-8').trim());
let value = data;
for (let i = 2; i < process.argv.length; i++) {
value = value[process.argv[i]] ?? null;
}
process.stdout.write(String(value), 'utf-8');