Skip to content

Instantly share code, notes, and snippets.

@juanpicado
Last active March 20, 2016 17:05
Show Gist options
  • Save juanpicado/862db53b9d91d9ca79d6 to your computer and use it in GitHub Desktop.
Save juanpicado/862db53b9d91d9ca79d6 to your computer and use it in GitHub Desktop.
escodegen.js
var escodegen = require('escodegen');
var js = escodegen.generate({
"type": "VariableDeclaration",
"start": 0,
"end": 6,
"range": [
0,
6
],
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 5,
"range": [
4,
5
],
"id": {
"type": "Identifier",
"start": 4,
"end": 5,
"range": [
4,
5
],
"name": "a"
},
"init": null
}
],
"kind": "var"
});
//output: var a;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment