-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Botaro Shinomiya edited this page Dec 29, 2024
·
1 revision
Welcome, This is Estige Wiki! In this page, you will learn the essentials to use Estige.
Open your favorite terminal (mine's kitty btw) and run this command:
npm install estige
After installation, you can use Estige however you want :3
You can import like so in CommonJS:
// Classic
const Estige = require( 'estige' );
// Partial
const { Traverser, Mangler, Optimizer, AST } = require( 'estige' );Estige has a Traverser, Mangler, Optimizer and some AST utilities. Traverser is for going through all of the AST nodes inside an AST node recursively. Mangler is for mangling property names inside an AST without breaking anything apart. Optimizer is a basic optimizer that will fix a dev's issues (in AST of course haha). AST utilites are for creating AST nodes out of Javascript/ECMAScript built-in types.
ASTManager -> class {
clone(): ASTNode
remove(): boolean
modify( obj: ASTNode, surfaceLevel: boolean = false ): void
replace( obj: ASTNode | ASTNode[] ): ( ASTNode | ASTNode[] )
get self(): ASTNode
}
TraverserFunction -> function ( node: ASTNode, manager: ASTManager )
Estige.Mangler.mangle -> function ( ast: Program | ASTNode, setup: { reserved: string[] } ): ( Program | ASTNode )
Estige.Optimizer.optimize -> function ( ast: Program | ASTNode ): ( Program | ASTNode )
Estige.Traverser.traverse -> function ( ast: Program | ASTNode, callback: Function | Object<ASTType of TraverserFunction>, setup: { destructive: boolean = false } ): ( Program | ASTNode )
Estige.Traverser.watch -> function ( ast: Program | ASTNode, callback: Function | Object<ASTType of TraverserFunction> ): ( Program | ASTNode )