Skip to content

Instantly share code, notes, and snippets.

@daybrush
Last active October 7, 2018 13:20
Show Gist options
  • Save daybrush/1d6f6c44928a51509fc6b84e883bc006 to your computer and use it in GitHub Desktop.
Save daybrush/1d6f6c44928a51509fc6b84e883bc006 to your computer and use it in GitHub Desktop.
traverse
import traverse from "@babel/traverse";
traverse(ast, {
FunctionDeclaration: function (path) {
// path.node (FunctionDeclaration)
// path.node.id (Identifier)
console.log(path.node.id.name);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment