escodegen


Nameescodegen JSON
Version 1.0.11 PyPI version JSON
download
home_page
SummaryECMAScript code generator
upload_time2023-04-13 05:21:20
maintainer
docs_urlNone
author
requires_python>=3.6
license
keywords ast ecmascript escodegen generate generator javascript
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            **Escodegen** ([escodegen](http://github.com/estools/escodegen)) is an
[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
(also popularly known as [JavaScript](http://en.wikipedia.org/wiki/JavaScript))
code generator from [Mozilla's Parser API](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)
AST. See the [online generator](https://estools.github.io/escodegen/demo/index.html)
for a demo. This repository contains the Python translation of Escodegen.


## Install

    pip install escodegen

## Usage

### Example:
```python
import escodegen

escodegen.generate({
    'type': 'BinaryExpression',
    'operator': '+',
    'left': { 'type': 'Literal', 'value': 20 },
    'right': { 'type': 'Literal', 'value': 2 }
})
```
*produces the string: `'20 + 2'`*

### Example:
```python
import escodegen
import esprima

escodegen.generate(esprima.parse('let a=10;let b=20'))
```
*produces the string: `'let a = 10;\nlet b = 20;'`*

See the [API page](https://github.com/estools/escodegen/wiki/API) for
options.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "escodegen",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "ast,ecmascript,escodegen,generate,generator,javascript",
    "author": "",
    "author_email": "0x78 <contact@0x78.com>",
    "download_url": "",
    "platform": null,
    "description": "**Escodegen** ([escodegen](http://github.com/estools/escodegen)) is an\n[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\n(also popularly known as [JavaScript](http://en.wikipedia.org/wiki/JavaScript))\ncode generator from [Mozilla's Parser API](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)\nAST. See the [online generator](https://estools.github.io/escodegen/demo/index.html)\nfor a demo. This repository contains the Python translation of Escodegen.\n\n\n## Install\n\n    pip install escodegen\n\n## Usage\n\n### Example:\n```python\nimport escodegen\n\nescodegen.generate({\n    'type': 'BinaryExpression',\n    'operator': '+',\n    'left': { 'type': 'Literal', 'value': 20 },\n    'right': { 'type': 'Literal', 'value': 2 }\n})\n```\n*produces the string: `'20 + 2'`*\n\n### Example:\n```python\nimport escodegen\nimport esprima\n\nescodegen.generate(esprima.parse('let a=10;let b=20'))\n```\n*produces the string: `'let a = 10;\\nlet b = 20;'`*\n\nSee the [API page](https://github.com/estools/escodegen/wiki/API) for\noptions.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "ECMAScript code generator",
    "version": "1.0.11",
    "split_keywords": [
        "ast",
        "ecmascript",
        "escodegen",
        "generate",
        "generator",
        "javascript"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf339d9637765f4f024740185e5ebaae28acdaa9d54b831d3bb6a11a82834447",
                "md5": "2f557db558d6eb38647c0b145a48cca3",
                "sha256": "2e46fbbef86faf175165c8ebaa2207b1ee5624918ee9e1daf67fa247d2dbb074"
            },
            "downloads": -1,
            "filename": "escodegen-1.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f557db558d6eb38647c0b145a48cca3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 20259,
            "upload_time": "2023-04-13T05:21:20",
            "upload_time_iso_8601": "2023-04-13T05:21:20.708809Z",
            "url": "https://files.pythonhosted.org/packages/bf/33/9d9637765f4f024740185e5ebaae28acdaa9d54b831d3bb6a11a82834447/escodegen-1.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-13 05:21:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "escodegen"
}
        
Elapsed time: 0.05478s