diff --git a/.bin/count-json-objects.js b/.bin/count-json-objects.js new file mode 100755 index 0000000..2c6e0ef --- /dev/null +++ b/.bin/count-json-objects.js @@ -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)))))