JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 599
  • Score
    100M100P100Q90772F
  • License ISC

A blazing fast 100% spec compliant, self-hosted javascript parser written in Typescript

Package Exports

  • seafox

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (seafox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Seafox

A blazing fast 100% spec compliant, self-hosted javascript parser written in Typescript.


Features

  • Conforms to the standard ECMAScript® 2020 (ECMA-262 10th Edition) language specification
  • Support for additional ECMAScript features for Web Browsers
  • Optionally track syntactic node locations
  • Emits an ESTree-compatible abstract syntax tree.
  • No backtracking
  • Low memory usage
  • Very well tested (~40 000 unit tests with full code coverage)
  • Lightweight - ~88 KB minified

Installation

npm install seafox --save-dev

API

Seafox generates AST according to ESTree AST format, and can be used to perform syntactic analysis (parsing) of a JavaScript program, and with ES2015 and later a JavaScript program can be either a script or a module.

Seafox stricly follows the ECMA specifications so you have to specify whether to parse in parseScript mode (the default) or in parseModule mode.

This is the available options:

{
  // The flag to enable start and end offsets and line/column location information to each node
  loc: false;

  // Disable web compability
  disableWebCompat: false;

  // The flag to attach raw property to each literal and identifier node
  raw: false;

  // Enabled directives
  directives: false;

  // The flag to allow return in the global scope
  globalReturn: false;

  // The flag to enable implied strict mode
  impliedStrict: false;

// Enable non-standard parenthesized expression node
  preserveParens: false;
}