
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Reflect.js is a JavaScript (ES3 compatible) implementation of Mozilla's Parser API. It does not currently support some of Mozilla's extensions, such as generators, list comprehensions, for each
, E4X, etc. but may eventually support ones that are, or become Harmony proposals.
Builders are also supported.
Parsing really large files can be slow, for reasons articulated by Andy Chu.
You can download a minified-standalone version of reflect.js to embed in web pages here.
Reflect.js is available as a CommonJS module for Node.js. Simply install it with npm:
npm install reflect
var Reflect = require('reflect');
var ast = Reflect.parse("var a = 4 + 7");
console.log(Reflect.stringify(ast, " "));
Refer to Mozilla's docs for details on the AST interface.
The optional builder parameter to Reflect.parse() makes it possible to construct user-specified data from the parser, rather than the default Node objects.
The reflect.js module exports the default builder so you can redefine only the node constructors you care about and leave the rest default.
var Reflect = require('reflect');
var builder = Reflect.builder;
// redefine callback for variable declarations
builder["variableDeclaration"] = function (kind, declarators, loc) { ... };
var ast = Reflect.parse("var a = 4 + 7", {builder: builder});
MIT X Licensed.
FAQs
JavaScript parser adhering to Mozilla's parser API
The npm package reflect receives a total of 383 weekly downloads. As such, reflect popularity was classified as not popular.
We found that reflect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.