MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / get_acorn_version

Function get_acorn_version

code2flow/javascript.py:232–243  ·  view source on GitHub ↗

Get the version of installed acorn :rtype: str

()

Source from the content-addressed store, hash-verified

230
231
232def get_acorn_version():
233 """
234 Get the version of installed acorn
235 :rtype: str
236 """
237 proc = subprocess.Popen(['node', '-p', 'require(\'acorn/package.json\').version'],
238 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
239 cwd=os.path.dirname(os.path.realpath(__file__)))
240 assert proc.wait() == 0, "Acorn is required to parse javascript files. " \
241 "It was found on the path but could not be imported " \
242 "in node.\n" + proc.stderr.read().decode()
243 return proc.stdout.read().decode().strip()
244
245
246class Javascript(BaseLanguage):

Callers 1

assert_dependenciesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected