0

I'm looking for good JavaScript command-line parsers which are able to check the code syntax.

Compatible with *nix systems, ideally cross-platform libraries.

1 Answer 1

0

Here is the list of generic JavaScript parsers:

  • Acorn

    A small, fast, JavaScript-based JavaScript parser.

    Install via: npm -g install acorn.

  • Esprima

    A high performance, standard-compliant ECMAScript parser written in ECMAScript.

    Install via: npm -g install esprima.

  • TypeScript by Microsoft (GitHub)

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • Traceur

    Traceur is a JavaScript.next-to-JavaScript-of-today compiler.

  • Flow by Facebook (GitHub)

    JavaScript parser written in OCaml. Produces SpiderMonkey AST.

  • Babylon (GitHub)

    A JavaScript parser used in Babel.

Source: JavaScript parsers speed comparison.


Here is the speed comparison (ops/sec or type of error) for each parser/input combination.

JavaScript parsers speed comparison


Related: How can I check JavaScript code for syntax errors ONLY from the command line?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.