Skip to content

Instantly share code, notes, and snippets.

@recidive
Created February 3, 2014 21:58
Show Gist options
  • Select an option

  • Save recidive/8793283 to your computer and use it in GitHub Desktop.

Select an option

Save recidive/8793283 to your computer and use it in GitHub Desktop.
Exporting hook resources to JSON files in Choko.
var objectType = 'navigation';
var newObjects = newNavigations;
for (var i in newObjects) {
var newObject = newObjects[i];
require('fs').writeFileSync(require('path').join(__dirname, '/' + i + '.' + objectType + '.json'), JSON.stringify(newObject, null, ' '), {flag: 'w'});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment