
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
esprima-loader
Advanced tools
esprima-loader is a foundational utility loader for webpack. It is a simple glue and pipeline layer between webpack and any arbitrary AST transformations you want to apply.
It takes in the source and literally just pipes the AST through each transformer, reusing the AST structure to avoid the overhead of reducing to a string between each transformation.
var resultingAST = transforms.reduce(function(ast, transform) {
return estraverse[transform.type || 'replace'](ast, transform);
}, esprima.parse(source));
esprima-loader automates the busy parts of parsing and traversing the AST. As
the author of an esprima-loader transformer, you simply need to look at and
understand the estraverse
API.
// webpack.config.js
module.exports = {
esprima: {
transforms: [
{
type: 'replace', // or traverse
enter: function(node, parent) {},
leave: function(node, parent) {}
}
]
}
};
This uses the -fb
forks of each esprima project for JSX support. Namely,
esprima-fb
and estraverse-fb
. Regardless, due to escodegen
creating the
resulting JavaScript string it is required that this be the final step in your
pipeline.
The react-autodoc
project comes packages with a transformer to automate the
propType annotations required to resolve the runtime propType declarations.
View that project at skookum/react-autodoc.
Copyright 2015 Skookum Digital Works, Inc. All Right Reserved MIT...
FAQs
Arbitrary AST transforms for your webpack loader pipeline.
The npm package esprima-loader receives a total of 2 weekly downloads. As such, esprima-loader popularity was classified as not popular.
We found that esprima-loader 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.