Add script to count json objects
parent
07fbefb40e
commit
fdf721c2b6
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
|
const objLength = obj => Object.keys(obj).length
|
||||||
|
|
||||||
|
fs.readFile(process.argv[2], (err, data) => (err ? console.error(err) : console.log(objLength(JSON.parse(data)))))
|
Loading…
Reference in New Issue