All Projects → estools → Escodegen

estools / Escodegen

Licence: bsd-2-clause
ECMAScript code generator

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Escodegen

estree-to-babel
convert estree ast to babel
Stars: ✭ 23 (-99.01%)
Mutual labels:  ast, estree
kataw
An 100% spec compliant ES2022 JavaScript toolchain
Stars: ✭ 303 (-86.98%)
Mutual labels:  ast, estree
Estree
The ESTree Spec
Stars: ✭ 3,867 (+66.11%)
Mutual labels:  ast, estree
astravel
👟 Tiny and fast ESTree-compliant AST walker and modifier.
Stars: ✭ 38 (-98.37%)
Mutual labels:  ast, estree
eval-estree-expression
Safely evaluate JavaScript (estree) expressions, sync and async.
Stars: ✭ 22 (-99.05%)
Mutual labels:  ast, estree
esvalid
confirm that a SpiderMonkey format AST represents an ECMAScript program
Stars: ✭ 24 (-98.97%)
Mutual labels:  ast, estree
Babylon
PSA: moved into babel/babel as @babel/parser -->
Stars: ✭ 1,692 (-27.32%)
Mutual labels:  ast, estree
Bash Parser
Parses bash into an AST
Stars: ✭ 151 (-93.51%)
Mutual labels:  ast
Astpath
A command-line search utility for Python ASTs using XPath syntax.
Stars: ✭ 167 (-92.83%)
Mutual labels:  ast
Nativejsx
JSX to native DOM API transpilation. 💛 <div> ⟹ document.createElement('div')!
Stars: ✭ 145 (-93.77%)
Mutual labels:  ast
Js Sql Parser
SQL(select) parser written with jison. parse SQL into abstract syntax tree(AST) and stringify back to SQL. sql grammar follows https://dev.mysql.com/doc/refman/5.7/en/select.html
Stars: ✭ 141 (-93.94%)
Mutual labels:  ast
Ngast
Parser for Angular projects.
Stars: ✭ 152 (-93.47%)
Mutual labels:  ast
Retext
natural language processor powered by plugins part of the @unifiedjs collective
Stars: ✭ 2,119 (-8.98%)
Mutual labels:  ast
Ts Morph
TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Stars: ✭ 2,384 (+2.41%)
Mutual labels:  ast
Snapdragon
snapdragon is an extremely pluggable, powerful and easy-to-use parser-renderer factory.
Stars: ✭ 180 (-92.27%)
Mutual labels:  ast
Down
Blazing fast Markdown / CommonMark rendering in Swift, built upon cmark.
Stars: ✭ 1,895 (-18.6%)
Mutual labels:  ast
Flora Sql Parser
Parse SQL (select) statements into abstract syntax tree (AST) and convert ASTs back to SQL.
Stars: ✭ 186 (-92.01%)
Mutual labels:  ast
Llvm Guide Zh
User Guides For those new to the LLVM system.(LLVM系统的新用户指南,中文翻译版)
Stars: ✭ 180 (-92.27%)
Mutual labels:  ast
Query Translator
Query Translator is a search query translator with AST representation
Stars: ✭ 165 (-92.91%)
Mutual labels:  ast
Parser
A lexer and parser for GraphQL in .NET
Stars: ✭ 163 (-93%)
Mutual labels:  ast

Escodegen

npm version Build Status Dependency Status devDependency Status

Escodegen (escodegen) is an ECMAScript (also popularly known as JavaScript) code generator from Mozilla's Parser API AST. See the online generator for a demo.

Install

Escodegen can be used in a web browser:

<script src="escodegen.browser.js"></script>

escodegen.browser.js can be found in tagged revisions on GitHub.

Or in a Node.js application via npm:

npm install escodegen

Usage

A simple example: the program

escodegen.generate({
    type: 'BinaryExpression',
    operator: '+',
    left: { type: 'Literal', value: 40 },
    right: { type: 'Literal', value: 2 }
});

produces the string '40 + 2'.

See the API page for options. To run the tests, execute npm test in the root directory.

Building browser bundle / minified browser bundle

At first, execute npm install to install the all dev dependencies. After that,

npm run-script build

will generate escodegen.browser.js, which can be used in browser environments.

And,

npm run-script build-min

will generate the minified file escodegen.browser.min.js.

License

Escodegen

Copyright (C) 2012 Yusuke Suzuki (twitter: @Constellation) and other contributors.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].