{"library":"pegjs-loader","title":"pegjs-loader","description":"A webpack loader that compiles PEG.js grammar files into JavaScript parser modules. Current version 0.5.8 is stable with weekly npm downloads around 1,000. Requires peer dependencies PEG.js ^0.10.0 and webpack >=1. Supports options like cache, optimize, trace, allowedStartRules, and dependencies. Differentiated from alternatives like jison-loader by its tight integration with PEG.js and support for multiple parser options via query parameters.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install pegjs-loader"],"cli":null},"imports":["module.exports = { module: { loaders: [{ test: /\\.pegjs$/, loader: 'pegjs-loader' }] } }","const parser = require('./parser.pegjs');","const parser = require('pegjs-loader?cache=true!./parser.pegjs');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  entry: './src/index.js',\n  output: { filename: 'bundle.js' },\n  module: {\n    loaders: [\n      {\n        test: /\\.pegjs$/,\n        loader: 'pegjs-loader?cache=true&optimize=size'\n      }\n    ]\n  }\n};\n\n// src/index.js\nconst parser = require('./grammar.pegjs');\nconst result = parser.parse('input string');\nconsole.log(result);","lang":"javascript","description":"Configure webpack to use pegjs-loader on .pegjs files, then require and parse with the compiled parser.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}