For usage example, run:
   node ./examples/write-to-json.js

TODO:
- create an NPM package
- README
- more comprehensive tests