Skip to main content

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. This repository contains the Python translation of Escodegen.

Install

pip install escodegen

Usage

Example:

import escodegen

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

produces the string: '20 + 2'

Example:

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 for options.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

escodegen-1.0.11-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file escodegen-1.0.11-py3-none-any.whl.

File metadata

  • Download URL: escodegen-1.0.11-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.7

File hashes

Hashes for escodegen-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 2e46fbbef86faf175165c8ebaa2207b1ee5624918ee9e1daf67fa247d2dbb074
MD5 2f557db558d6eb38647c0b145a48cca3
BLAKE2b-256 bf339d9637765f4f024740185e5ebaae28acdaa9d54b831d3bb6a11a82834447

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.11 This release

1 file

1.0.10

1 file

1.0.9

1 file

1.0.8

1 file

1.0.7

1 file

1.0.6

1 file

1.0.5

1 file

1.0.4

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page