Skip to content

Instantly share code, notes, and snippets.

@edysegura
Created December 1, 2016 11:58
Show Gist options
  • Save edysegura/1d1bf77a058cbee40c444715613ef0f4 to your computer and use it in GitHub Desktop.
Save edysegura/1d1bf77a058cbee40c444715613ef0f4 to your computer and use it in GitHub Desktop.
[JS] How to create file in JavaScript Rhino
function generateJSONFile(spec) {
var
json = JSON.stringify(specAttributes, null, 2),
file = new FileWriter("c:/temp/" + spec + ".json");
file.write(json);
file.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment