um-react-electron/um-react/scripts/read_json.mjs
梦丶随心飞 be0b8687f3 update
2023-08-30 06:25:50 +08:00

13 lines
283 B
JavaScript
Executable File

#!/usr/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');