escodegen-1.0.9
توضیحات
ECMAScript code generator
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | escodegen-1.0.9 |
| نام | escodegen |
| نسخه کتابخانه | 1.0.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | 0x78 <contact@0x78.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/escodegen/ |
| مجوز | - |
**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.
نیازمندی
| مقدار | نام |
|---|---|
| - | esutils |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl escodegen-1.0.9:
pip install escodegen-1.0.9.whl
نصب پکیج tar.gz escodegen-1.0.9:
pip install escodegen-1.0.9.tar.gz