acorn-bfs
/*** Returns an array of nodes in the passed AST, traversed using BFS. Accepts an* optional maximum number, n, of nodes to return. The returned array always* begins with the root node.** @param* @param*/
Installation
npm install --save acorn-bfs
Example
var acorn = ;var bfs = ;var ast = acorn;;// =>// ['Program', 'FunctionDeclaration', 'BlockStatement',// 'ReturnStatement', 'Literal']