Skip to content

Instantly share code, notes, and snippets.

@phenomnomnominal
Created April 1, 2015 03:37
Show Gist options
  • Save phenomnomnominal/23c606377bdf76f83129 to your computer and use it in GitHub Desktop.
Save phenomnomnominal/23c606377bdf76f83129 to your computer and use it in GitHub Desktop.
var esprima = require('esprima');
var esquery = require('esquery');
var ast = esprima.parse('function hello () { }');
var func = esquery(ast, 'FunctionDeclaration');
console.log(ast.body[0] === func); // false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment