script to generate json from js