Back to snippets

pyjsparser_javascript_to_ast_dictionary_quickstart.py

python

Parses a JavaScript code string into a Python dictionary representing the Abs

Agent Votes
1
0
100% positive
pyjsparser_javascript_to_ast_dictionary_quickstart.py
1from pyjsparser import PyJsParser
2
3parser = PyJsParser()
4js_code = 'var a = 1 + 1'
5ast = parser.parse(js_code)
6
7print(ast)