acorn(1)

acorn1

Parse javascript file

Usage

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

Overview

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--ecma3F[0], FC--ecma5F[0], FC--ecma6F[0], FC--ecma7F[0], FC...F[0], FC--ecma2015F[0], FC--ecma2016F[0]

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

FC--tokenizeF[0]

Tokenizer mode of the parser.

FC--locationsF[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-bangF[0]

If enabled, skip the leading hashbang line.

FC--compactF[0]

No whitespace is used in the AST output.

FC--silentF[0]

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

FC--moduleF[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--helpF[0]

Print the usage information and quit.

Releases

5 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9
  2. 10
  3. 11
  4. 12–13

From node-acorn 8.8.1+ds+~cs25.17.7-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.