---
name: "acorn"
section: "1"
platform: "linux"
package: "node-acorn"
version: "8.8.1+ds+~cs25.17.7-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/acorn"
---

# acorn(1)

parse JavaScript file

## NAME

acorn - parse JavaScript file

## SYNOPSIS

**acorn**  \[**--ecma3** \| **--ecma5** \| **--ecma6** \| **--ecma7** \| **...** \| **--ecma2015** \| **--ecma2016**\] \[**--tokenize**\] \[**--locations**\] \[**--allow-hash-bang**\] \[**--compact**\] \[**--silent**\] \[**--module**\] \[**--help**\] \[**--**\] \[**infile**\]

## DESCRIPTION

**acorn** is a utility to parse a JavaScript file from the command line. It accepts as arguments the input file. The utility spits out the syntax tree as JSON data.

## OPTIONS

- FC**--ecma3**F\[0\], FC**--ecma5**F\[0\], FC**--ecma6**F\[0\], FC**--ecma7**F\[0\], FC**...**F\[0\], FC**--ecma2015**F\[0\], FC**--ecma2016**F\[0\]

  Sets the ECMAScript version to parse. Default is version 7.

- FC**--tokenize**F\[0\]

  Tokenizer mode of the parser.

- FC**--locations**F\[0\]

  Attaches a "loc" object to each node with "start" and "end" subobjects, each of which contains the one-based line and zero-based column numbers in {line, column} form.

- FC**--allow-hash-bang**F\[0\]

  If enabled, skip the leading hashbang line.

- FC**--compact**F\[0\]

  No whitespace is used in the AST output.

- FC**--silent**F\[0\]

  Do not output the AST, just return the exit status.

- FC**--module**F\[0\]

  Indicates the code shouldn't be parsed as a script but as a module. This influences global strict mode and 'import' and 'export' declarations.

- FC**--help**F\[0\]

  Print the usage information and quit.
