Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
pegjs-import-loader
Advanced tools
A simple loader for PEG.js that supports importing multiple grammars from different PEG.js files
npm install --save-dev pegjs-import-loader pegjs webpack
webpack.config.js:
module.exports = {
...
module: {
loaders: [
{
test: /\.pegjs$/,
loader: 'pegjs-import-loader',
options: {
...
}
}
]
}
};
You can pass options to PEG.js through options property in webpack config. See more about PEG.js options
parser.pegjs:
{
const str = 'This is just an example string';
function concat(a, b) {
return a.concat(b);
}
}
Expression
= head:Term tail:(_ ("+" / "-") _ Term)* {
return tail.reduce(function(result, element) {
if (element[1] === "+") { return result + element[3]; }
if (element[1] === "-") { return result - element[3]; }
}, head);
}
Factor
= "(" _ expr:Expression _ ")" { return expr; }
/ Integer
@import './base-rules.pegjs'
@import './keywords.pegjs'
const parser = require('./parser.pegjs');
const result = parser.parse(content);
FAQs
PEG.js import loader for webpack
The npm package pegjs-import-loader receives a total of 26 weekly downloads. As such, pegjs-import-loader popularity was classified as not popular.
We found that pegjs-import-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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.