{"id":26100742,"url":"https://github.com/eploko/pegjs-loader","last_synced_at":"2025-04-12T15:10:43.799Z","repository":{"id":23402952,"uuid":"26765116","full_name":"eploko/pegjs-loader","owner":"eploko","description":"PEG.js loader for webpack","archived":false,"fork":false,"pushed_at":"2024-08-27T19:53:46.000Z","size":461,"stargazers_count":29,"open_issues_count":7,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T21:08:57.996Z","etag":null,"topics":["javascript","loader","peg","pegjs","pegjs-loader","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eploko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-17T16:15:02.000Z","updated_at":"2023-08-07T14:23:01.000Z","dependencies_parsed_at":"2024-06-18T14:22:19.963Z","dependency_job_id":"e63cfa00-bf8e-4915-a86b-6775d3f024c9","html_url":"https://github.com/eploko/pegjs-loader","commit_stats":{"total_commits":70,"total_committers":7,"mean_commits":10.0,"dds":0.2142857142857143,"last_synced_commit":"3f4cc980a807e09192ab1321feae7f94771fe3fe"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eploko%2Fpegjs-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eploko%2Fpegjs-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eploko%2Fpegjs-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eploko%2Fpegjs-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eploko","download_url":"https://codeload.github.com/eploko/pegjs-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586231,"owners_count":21128997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","loader","peg","pegjs","pegjs-loader","webpack","webpack-loader"],"created_at":"2025-03-09T17:52:54.070Z","updated_at":"2025-04-12T15:10:43.775Z","avatar_url":"https://github.com/eploko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [PEG.js](https://github.com/pegjs/pegjs) loader for [webpack](http://webpack.github.io/)\n\n[![npm version](https://img.shields.io/npm/v/pegjs-loader.svg?style=flat-square)](https://www.npmjs.com/package/pegjs-loader)\n[![npm downloads](https://img.shields.io/npm/dm/pegjs-loader.svg?style=flat-square)](https://www.npmjs.com/package/pegjs-loader)\n\n## Install\n\n`npm install --save-dev pegjs-loader pegjs webpack`\n\nThe pegjs-loader requires [PEG.js](https://github.com/pegjs/pegjs) and [webpack](https://github.com/webpack/webpack)\nas [`peerDependency`](https://docs.npmjs.com/files/package.json#peerdependencies). Thus you are able to specify the required versions accurately.\n\n## Usage\n\n[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)\n\n``` js\nvar parser = require(\"!pegjs!./parser.pegjs\");\n// =\u003e returns compiled PEG.js parser\n```\n\n### Apply via webpack config\n\nIt's recommended to adjust your `webpack.config` so `pegjs!` is applied automatically on all files ending with `.pegjs`:\n\n``` js\nmodule.exports = {\n  ...\n  module: {\n    loaders: [\n      {\n        test: /\\.pegjs$/,\n        loader: 'pegjs-loader'\n      }\n    ]\n  }\n};\n```\n\nThen you only need to write: `require(\"./parser.pegjs\")`.\n\n### PEG.js options\n\nYou can pass options to PEG.js as [query parameters](http://webpack.github.io/docs/using-loaders.html#query-parameters). The following options are supported:\n\n  * `allowedStartRules` - The rules the built parser will be allowed to start\n    parsing from (default: the first rule in the grammar).\n\n  * `cache` — If `true`, makes the parser cache results, avoiding exponential\n    parsing time in pathological cases but making the parser slower (default:\n    `false`).\n\n  * `dependencies` - Parser dependencies, the value is an object which maps variables used to access the\n    dependencies in the parser to module IDs used to load them (default: `{}`).\n\n  * `optimize` - Whether to optimize the built parser either for `speed` or\n    `size` (default: `speed`).\n\n  * `trace` - If `true`, the tracing support in the built parser is enabled\n    (default: `false`).\n\n``` js\nmodule.exports = {\n  ...\n  module: {\n    loaders: [\n      {\n        test: /\\.pegjs$/,\n        loader: 'pegjs-loader?cache=true\u0026optimize=size\u0026allowedStartRules[]=RuleA,allowedStartRules[]=RuleB\u0026trace=true'\n      }\n    ]\n  }\n};\n```\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](http://semver.org/).  \nEvery release, along with the migration instructions, if any, is documented on the Github [Releases](https://github.com/eploko/pegjs-loader/releases) page.\n\n## Thanks\n\n* [Victor Homyakov](https://github.com/victor-homyakov) for the propagation of the `cache` option.\n* [VladimirTechMan](https://github.com/VladimirTechMan) for the propagation of the `optimize` option and updating things to be compatible with PEG.js 0.10.0.\n* [ragtime](https://github.com/ragtime) for the propagation of the `allowedStartRules` and `trace` options.\n* [Jan Varwig](https://github.com/janv) for the Webpack 2 compatibility fix.\n* [retorquere](https://github.com/retorquere) for the propagation of the `dependencies` option.\n\n## License\n\nMIT (http://www.opensource.org/licenses/mit-license.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feploko%2Fpegjs-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feploko%2Fpegjs-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feploko%2Fpegjs-loader/lists"}