ZeParser is an early-stage JavaScript parser, last published as version 0.0.7 in June 2013. Developed by Peter van der Zee, it was designed to convert JavaScript input into a 'parse tree' (an array of arrays with tokens as leaves) or various token streams, including a 'white tree' (all tokens, including whitespace) and a 'black tree' (token stream without whitespace). The package also offered a `createParser` method to instantiate a parser with parsed input and access these tree structures directly. It featured simple and extended parsing modes, with the extended mode providing richer meta-information. While historically relevant for JavaScript parsing benchmarks, the project has been abandoned since its last release, meaning it does not support modern JavaScript syntax (ES2015+), lacks ongoing maintenance, and has no defined release cadence. An experimental v2 (`zeparser2`) was later introduced but also appears to be unmaintained.
npm install zeparserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `ZeParser.parse()` to get a basic parse tree and `ZeParser.createParser()` to access detailed token streams (including and excluding whitespace/comments). It highlights the CommonJS `require` syntax.
Use a modern JavaScript parser like Acorn, Babel Parser (@babel/parser), or Esprima for any code written post-ES5.
Always use `const ZeParser = require('zeparser');` for importing. If used in a modern ESM project, it might require a CommonJS wrapper or bundler configuration to work, but its primary limitation remains its inability to parse modern JS.Thoroughly inspect the outputted `parseTree`, `.wtree`, and `.btree` structures for specific token properties and array nesting. Expect a custom AST format rather than a standardized one.
This parser is only compatible with ES5 (ECMAScript 5) and older syntax. It cannot parse modern JavaScript. Use a different, actively maintained parser.
Ensure you are using `const ZeParser = require('zeparser');` and then calling `ZeParser.parse(yourCode);`. This package is CommonJS, and its methods are accessed directly from the required module object.This package is intended for Node.js environments. For browser usage, you would need a tool like Webpack or Browserify to bundle it, but given its abandonment and lack of modern JS support, it's not recommended for new web projects.
No dependency data recorded yet.