0.2.0 • Published 6 years ago

cherow-cli v0.2.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

Cherow CLI

Command line interface for Cherow ECMAScript parser.

This package can be used to parse a file from the command line. By default it accepts as arguments a input file, but this can be changed with the s flag which allows you to pass in code as in the V8 REPL.

The CLI conforms to the standard ECMAScript® 2019 (ECMA-262 9th Edition) language specification (draft)

Usage

Install it either global or locale, and type cherow from the command line. The syntax tree will be printed as JSON data.

// Source code
cherow -s -l function foo() {}

// Source file
cherow -l foo.js

Arguments

Shorthand is the first letter. E.g. h for help or l for loc.

ArgumentsDescription
helpPrint all available arguments
moduleEnable module syntax
locAttach line/column location information to each node
rangesAppend start and end offsets to each node
globalReturnAllow return in the global scope
impliedStrictEnable strict mode initial enforcement
nextEnable stage 3 support (ESNext)
jsxEnable React JSX parsing
sourceLet you pass code instead of a file (like V8 REPL)
rawAttach raw property to each literal node
experimentalEnable experimental features

JSX

React JSX parsing can be enabled with the jsx argument.