ASTGenerator
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
staticparse
ASTGenerator returns an instance of ParserData containing a string representing the rendered code of the provided AST
node. In addition Halstead operators and operands are available via ParserData.Parameters
node: any
An ESTree or Babylon AST node.
options: { indent: string; lineEnd: string; startingIndentLevel: number } = ...
Optional parameters for source code formatting.
Returns default
staticparseNodes
ASTGenerator returns an instance of ParserData containing a string representing the rendered code of the provided AST
nodes. In addition Halstead operators and operands are available via ParserData.Parameters
nodes: any[]
An array of ESTree or Babylon AST nodes to parse.
options: { indent: string; lineEnd: string; startingIndentLevel: number } = ...
Optional parameters for source code formatting.
Returns default
ASTGeneratoris a fork ofAstring. The original author is David Bonnet andAstringis released under an MIT license. This version is only available by the MPLv2.0 license. Please see the original source.https://github.com/davidbonnet/astring.git
Eventually once ASTGenerator is feature complete for Babylon & ESTree AST and further modularized it will be released as a separate NPM module supporting plugins.
Please note that not all of the Babylon AST nodes are currently supported.
astParseris currently only used bytyphonjs-escomplexfor realizing computed method names and associated Halstead operands and operators.