{"library":"nearley-loader","title":"nearley-loader","description":"A webpack loader that imports compiled nearley parser grammar files (`.ne` files) directly into JavaScript modules. Current stable version is 2.0.0, compatible with nearley^2.0.0. It integrates with webpack's module bundling, allowing developers to require grammar files and get compiled parser rules. The loader has a peer dependency on nearley, requiring matching major versions. It is commonly used in projects that build parsers with nearley and bundle with webpack. No release cadence is documented; the package is stable but low-maintenance.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install nearley-loader"],"cli":null},"imports":["import grammar from './grammar.ne';","import { Parser, Grammar } from 'nearley';","const parser = new Parser(Grammar.fromCompiled(grammar));"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      { test: /\\.nearley$/i, use: ['nearley-loader'] },\n    ],\n  },\n};\n\n// yourModule.js\nimport { Parser, Grammar } from 'nearley';\nimport grammar from './grammar.ne';\n\nconst parser = new Parser(Grammar.fromCompiled(grammar));\nparser.feed('some input');\nconsole.log(parser.results);\n","lang":"javascript","description":"Configures webpack to load .nearley files and shows how to use the compiled grammar with nearley's Parser.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}