Skip to main content

Construct javascript AST structures using python objects.

Project description

Construct javascript AST structures using python objects.

Requirements

  • Python 2.7

Setup

$ python -m pip install --user jast
or
(venv)$ python -m pip install jast

Usage

$ python
>>> import jast
>>> jast.Object({"a": 1, "b": 2}).ast()
'{
  "type": "ObjectExpression",
  "properties": [
      {
          "type": "ObjectProperty",
          "method": false,
          "key": {
              "type": "Identifier",
              "name": "a",
              "definition": null
          },
          "computed": false,
          "shorthand": false,
          "value": {
              "type": "NumericLiteral",
              "value": 1,
              "extra": {
                  "rawValue": 1,
                  "raw": "1"
              }
          }
      },
      {
          "type": "ObjectProperty",
          "method": false,
          "key": {
              "type": "Identifier",
              "name": "b",
              "definition": null
          },
          "computed": false,
          "shorthand": false,
          "value": {
              "type": "StringLiteral",
              "value": "2",
              "extra": {
                  "rawValue": "2",
                  "raw": "\"2\""
              }
          }
      }
  ]
 }'

ChangeLog

1.0.0-beta (2019-02-07)

  • Initial release.

Project details


Download files

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

Source Distribution

jast-1.0.0b1.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

jast-1.0.0b1-py2.py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page