{"versions":{"1.0.0":{"name":"apg-lite","version":"1.0.0","type":"module","description":"lightweight JavaScript APG parser","main":"lib/parser.js","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","apg":"node_modules/apg-js/bin/apg.sh","terser":"terser","ast":"node ast-app/parser-app.js && node ast-app/ast-app.js","basic":"node basic-app/node-app.js","cool":"node cool-app/node-app.js","lookahead":"node lookahead-app/positive-app.js && node lookahead-app/negative-app.js","trace":"node trace-app/node-app.js","udt":"node udt-app/node-app.js","uri":"node uri-app/node-app.js"},"repository":{"type":"git","url":"git+https://github.com/ldthomas/apg-lite.git"},"keywords":["APG","parser","ABNF","SABNF"],"jest":{"bail":1,"verbose":true,"testRegex":"/__tests__/.*\\.test\\.js"},"author":{"name":"Lowell D. Thomas","email":"ldt@sabnf.com","url":"https://sabnf.com/"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ldthomas/apg-lite/issues"},"homepage":"https://github.com/ldthomas/apg-lite#readme","devDependencies":{"apg-js":"^4.3.0","eslint":"^7.26.0","eslint-config-airbnb":"^18.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","jest":"^29.7.0","prettier":"^2.3.0","terser":"^5.24.0"},"_id":"apg-lite@1.0.0","gitHead":"88228f64e290d7fa15fcd39dd817d2dbdecf228d","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-TLX4C6h3Kr7fqP2cG9/r3uEIFJb/NuQCuq8bfI4qPN93zruGOmZpotGwTm1rO+Dd3vgHOijkEeUh63P8pP2YAQ==","shasum":"f9b7ca7318ae4e1b8f05280c1011de854fa4f3ad","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/apg-lite/-/apg-lite-1.0.0.tgz","fileCount":4,"unpackedSize":43986,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfO7k/jloKdpCgIUP79fWioj5tCmgchadqW/E1zsOEHAiEAkumCR1cs5alorPHyk4cjfir2XBHQ7NVDxzCUbNATRqg="}]},"_npmUser":{"name":"anonymous","email":"ldt@sabnf.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"ldt@sabnf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apg-lite_1.0.0_1701113832479_0.5435516447271651"},"_hasShrinkwrap":false,"contributors":[]},"1.0.1":{"name":"apg-lite","version":"1.0.1","type":"module","description":"lightweight JavaScript APG parser","main":"lib/parser.js","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","apg":"node_modules/apg-js/bin/apg.sh","terser":"terser","ast":"node ast-app/parser-app.js && node ast-app/ast-app.js","basic":"node basic-app/node-app.js","cool":"node cool-app/node-app.js","lookahead":"node lookahead-app/positive-app.js && node lookahead-app/negative-app.js","trace":"node trace-app/node-app.js","udt":"node udt-app/node-app.js","uri":"node uri-app/node-app.js"},"repository":{"type":"git","url":"git+https://github.com/ldthomas/apg-lite.git"},"keywords":["APG","parser","ABNF","SABNF"],"jest":{"bail":1,"verbose":true,"testRegex":"/__tests__/.*\\.test\\.js"},"author":{"name":"Lowell D. Thomas","email":"ldt@sabnf.com","url":"https://sabnf.com/"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ldthomas/apg-lite/issues"},"homepage":"https://github.com/ldthomas/apg-lite#readme","devDependencies":{"apg-js":"^4.3.0","eslint":"^7.26.0","eslint-config-airbnb":"^18.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","jest":"^29.7.0","prettier":"^2.3.0","terser":"^5.24.0"},"_id":"apg-lite@1.0.1","gitHead":"106ac8228f4efd275ce900c3b4cf87dcf0ca556e","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-wnTYXyNUfwzDEZIlfXQX0dJ06hZvvMKsbmpTBFHhjJcSogvP57PuSRZVmCTdVLzhQAIZ6ncqxe9UhPLDxColww==","shasum":"ae36eaf66fddafe0be1ec7941663ca68bd181795","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/apg-lite/-/apg-lite-1.0.1.tgz","fileCount":4,"unpackedSize":43986,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXGJD65mjLl9ySVz0fpkpQZ5hSzmd7NXqFl7OYfPND4AIgWX+ASd28BGBOTaFFdACiIPtW38fE6BtPVqrUPsRXTao="}]},"_npmUser":{"name":"anonymous","email":"ldt@sabnf.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"ldt@sabnf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apg-lite_1.0.1_1701114644115_0.8699563204996104"},"_hasShrinkwrap":false,"contributors":[]},"1.0.2":{"name":"apg-lite","version":"1.0.2","type":"module","description":"lightweight JavaScript APG parser","main":"lib/parser.js","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","apg":"node_modules/apg-js/bin/apg.sh","terser":"terser","ast":"node ast-app/parser-app.js && node ast-app/ast-app.js","basic":"node basic-app/node-app.js","cool":"node cool-app/node-app.js","lookahead":"node lookahead-app/positive-app.js && node lookahead-app/negative-app.js","trace":"node trace-app/node-app.js","udt":"node udt-app/node-app.js","uri":"node uri-app/node-app.js"},"repository":{"type":"git","url":"git+https://github.com/ldthomas/apg-lite.git"},"keywords":["APG","parser","ABNF","SABNF"],"jest":{"bail":1,"verbose":true,"testRegex":"/__tests__/.*\\.test\\.js"},"author":{"name":"Lowell D. Thomas","email":"ldt@sabnf.com","url":"https://sabnf.com/"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ldthomas/apg-lite/issues"},"homepage":"https://github.com/ldthomas/apg-lite#readme","devDependencies":{"apg-js":"^4.3.0","eslint":"^7.26.0","eslint-config-airbnb":"^18.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","jest":"^29.7.0","prettier":"^2.3.0","terser":"^5.24.0"},"_id":"apg-lite@1.0.2","gitHead":"10cb49d3ed0383c7472c1a5e9eae0b70a05e2c46","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-HvCR3+MQ8S4KK5lHsXv8MtWcdbt9PDaxRMuTvChLoiIpmoE+LW9FrHQea2ZU1llCPucDNAojMMe2bTArsWPDAw==","shasum":"387de978607e036aff1d1ff7a830930f8d3a47be","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/apg-lite/-/apg-lite-1.0.2.tgz","fileCount":71,"unpackedSize":545292,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbItmOJqLDWTZNmiNglMERXJWzPF8Lk6LiniMLmLLSbAiBBFOZunQIuyTj+BkMhXPceoOr8yLDn0hTo4Bm8Vg2f/A=="}]},"_npmUser":{"name":"anonymous","email":"ldt@sabnf.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"ldt@sabnf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apg-lite_1.0.2_1701115757671_0.06603974666951618"},"_hasShrinkwrap":false,"contributors":[]},"1.0.3":{"name":"apg-lite","version":"1.0.3","type":"module","description":"lightweight JavaScript APG parser","main":"lib/parser.js","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","apg":"node_modules/apg-js/bin/apg.sh","regen":"bin/regen.sh","min":"bin/min.sh","terser":"terser","ast":"node ast-app/parser-app.js && node ast-app/ast-app.js","basic":"node basic-app/node-app.js","cool":"node cool-app/node-app.js","lookahead":"node lookahead-app/positive-app.js && node lookahead-app/negative-app.js","trace":"node trace-app/node-app.js","udt":"node udt-app/node-app.js","uri":"node uri-app/node-app.js"},"repository":{"type":"git","url":"git+https://github.com/ldthomas/apg-lite.git"},"keywords":["APG","parser","ABNF","SABNF"],"jest":{"bail":1,"verbose":true,"testRegex":"/__tests__/.*\\.test\\.js"},"author":{"name":"Lowell D. Thomas","email":"ldt@sabnf.com","url":"https://sabnf.com/"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ldthomas/apg-lite/issues"},"homepage":"https://github.com/ldthomas/apg-lite#readme","devDependencies":{"apg-js":"^4.4.0","eslint":"^7.26.0","eslint-config-airbnb":"^18.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","jest":"^29.7.0","prettier":"^2.3.0","terser":"^5.24.0"},"_id":"apg-lite@1.0.3","gitHead":"070344b6b46fb263b90061f326420b49c0bc0488","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-lOoNkL7vN7PGdyQMFPey1aok2oVVqvs3n7UMFBRvQ9FoELSbKhgPc3rd7JptaGwCmo4125gLX9Cqb8ElvLCFaQ==","shasum":"8df04fb6bed08939e0b297a6eb47ff2e4f002a6a","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/apg-lite/-/apg-lite-1.0.3.tgz","fileCount":76,"unpackedSize":554966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHSYTm38FGmOqwap0vP6W/wnVnRSUuYr/1MptP0FWpC1AiEAkGIwiyqkVOkA+mVTQQpkOScjAt4oRYknNAmVMWE0teo="}]},"_npmUser":{"name":"anonymous","email":"ldt@sabnf.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"ldt@sabnf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apg-lite_1.0.3_1715002420994_0.7938791700100689"},"_hasShrinkwrap":false,"contributors":[]},"1.0.4":{"name":"apg-lite","version":"1.0.4","type":"module","description":"lightweight JavaScript APG parser","main":"lib/parser.js","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","apg":"node_modules/apg-js/bin/apg.sh","regen":"bin/regen.sh","min":"bin/min.sh","terser":"terser","ast":"node ast-app/parser-app.js && node ast-app/ast-app.js","basic":"node basic-app/node-app.js","cool":"node cool-app/node-app.js","lookahead":"node lookahead-app/positive-app.js && node lookahead-app/negative-app.js","trace":"node trace-app/node-app.js","udt":"node udt-app/node-app.js","uri":"node uri-app/node-app.js"},"repository":{"type":"git","url":"git+https://github.com/ldthomas/apg-lite.git"},"keywords":["APG","parser","ABNF","SABNF"],"jest":{"bail":1,"verbose":true,"testRegex":"/__tests__/.*\\.test\\.js"},"author":{"name":"Lowell D. Thomas","email":"ldt@sabnf.com","url":"https://sabnf.com/"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ldthomas/apg-lite/issues"},"homepage":"https://github.com/ldthomas/apg-lite#readme","devDependencies":{"apg-js":"^4.4.0","eslint":"^7.26.0","eslint-config-airbnb":"^18.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","jest":"^29.7.0","prettier":"^2.3.0","terser":"^5.24.0"},"_id":"apg-lite@1.0.4","gitHead":"de57f61ff21e78194cf2f0bd2d87f386fc5fef4f","_nodeVersion":"22.3.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-B32zCN3IdHIc99Vy7V9BaYTUzLeRA8YXYY1aQD1/5I2aqIrO0coi4t6hJPqMisidlBxhyME8UexkHt31SlR6Og==","shasum":"d517a8d775659603cb0c70843355954b73e88cc7","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/apg-lite/-/apg-lite-1.0.4.tgz","fileCount":76,"unpackedSize":557795,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4+thxBKBWIIkQjb3gTs3CdV5iJuLO/noNMhrxHtjmKQIhAIp8VYTiGyn8Qeh+EIjtI5inW9YapC5mlOSBrJeXhZF1"}],"size":106676},"_npmUser":{"name":"anonymous","email":"ldt@sabnf.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apg-lite_1.0.4_1719859502720_0.6410998265797592"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-01T18:45:02.879Z","publish_time":1719859502879,"_source_registry_name":"default","contributors":[]},"1.0.5":{"name":"apg-lite","version":"1.0.5","type":"module","description":"lightweight JavaScript APG parser","main":"lib/parser.js","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","apg":"node_modules/apg-js/bin/apg.sh","regen":"bin/regen.sh","min":"bin/min.sh","terser":"terser","ast":"node ast-app/parser-app.js && node ast-app/ast-app.js","basic":"node basic-app/node-app.js","cool":"node cool-app/node-app.js","lookahead":"node lookahead-app/positive-app.js && node lookahead-app/negative-app.js","trace":"node trace-app/node-app.js","udt":"node udt-app/node-app.js","uri":"node uri-app/node-app.js"},"repository":{"type":"git","url":"git+https://github.com/ldthomas/apg-lite.git"},"keywords":["APG","parser","ABNF","SABNF"],"jest":{"bail":1,"verbose":true,"testRegex":"/__tests__/.*\\.test\\.js"},"author":{"name":"Lowell D. Thomas","email":"ldt@sabnf.com","url":"https://sabnf.com/"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ldthomas/apg-lite/issues"},"homepage":"https://github.com/ldthomas/apg-lite#readme","devDependencies":{"apg-js":"^4.4.0","eslint":"^7.26.0","eslint-config-airbnb":"^18.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","jest":"^29.7.0","prettier":"^2.3.0","terser":"^5.24.0"},"_id":"apg-lite@1.0.5","gitHead":"4024634df5301159eda68203fdab28fbb2385d06","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-SlI+nLMQDzCZfS39ihzjGp3JNBQfJXyMi6cg9tkLOCPVErgFsUIAEdO9IezR7kbP5Xd0ozcPNQBkf9TO5cHgWw==","shasum":"17aee0e8452cb4ce7c7018dc54e53046cb31878b","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/apg-lite/-/apg-lite-1.0.5.tgz","fileCount":76,"unpackedSize":571911,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDYfjlSgRqHK7ujpZiJCRofaryDP3MALIOPSYNoVHXpOQIhAPMpanUpsZ2HaV+6OqHULWlz27s3DIDA4H7kF6EfaB5Q"}],"size":107442},"_npmUser":{"name":"anonymous","email":"ldt@sabnf.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"ldt@sabnf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/apg-lite_1.0.5_1748455441540_0.20888050156553262"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-28T18:04:01.743Z","publish_time":1748455441743,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.0.5"},"name":"apg-lite","time":{"created":"2023-11-28T00:02:37.575Z","1.0.0":"2023-11-27T19:37:12.748Z","modified":"2025-05-28T18:08:31.953Z","1.0.1":"2023-11-27T19:50:44.380Z","1.0.2":"2023-11-27T20:09:17.935Z","1.0.3":"2024-05-06T13:33:41.151Z","1.0.4":"2024-07-01T18:45:02.879Z","1.0.5":"2025-05-28T18:04:01.743Z"},"readme":"# APG Lite\r\n\r\n`apg-lite` is a light-weight parser of [ABNF](https://www.rfc-editor.org/rfc/rfc5234) grammars.\r\nIt is a parser only.\r\nIt relies on [apg-js](https://github.com/ldthomas/apg-js), version 4.3.0 or higher, with the new `--lite` option\r\nto generate ESM grammar objects.\r\n`apg-lite` features:\r\n\r\n- Parses only JavaScript strings, whereas `apg-js` can parse any arbitrary array of positive integers.\r\n- Retains only three of the eight [SABNF](https://sabnf.com/docs/python/md_docs_SABNF.html) superset operators of `apg-js`.\r\n  - UDT, (User-Defined Terminals) Handwritten, phrase-matching code snippets.\r\n  - AND, The positive look-ahead operator (see [syntactic predicates](https://en.wikipedia.org/wiki/Syntactic_predicate)).\r\n  - NOT, The negative look-ahead operator.\r\n- The AST has been simplified (see `./ast-app/`).\r\n- Tracing (debugging) the parse tree has been simplified (see `./trace-app/`).\r\n- Statistics collection (profiling) has been simplified (see `./trace-app/`).\r\n- `apg-lite` is fully contained in a single JavaScript file.\r\n  - `./lib/parser.js` contains ECMAScript Modules (ESM) which can be `import`-ed into your application.\r\n  - `./lib/web-parser.js` can be scripted into your web page application with no bundling necessary.\r\n\r\nA number of example application are included here to demonstrate the use of `apg-lite` in both\r\nNode.js and web page applications. Each example application is in its own directory.\r\nThe documentation for each is in the file `documentation.md`.\r\nMost (but not all) examples will be presented as both Node.js and web page applications.\r\n\r\n- `./basic-app/` - A simple parser demonstrating the most basic construction and use of a parser.\r\n- `./ast-app/` - Use of the AST - how to construct the AST and translate or semantically manipulate the phrases captured by the AST nodes.\r\n  Demonstrates generating an XML version of the AST.\r\n- `./udt-app/` - Use of a UDT, a handwritten code snippet to recognize a somewhat complicated phrase.\r\n- `./lookahead-app/` - Demonstration of the look ahead operators.\r\n- `./trace-app/` - How to debug and profile the parse tree.\r\n  - Tracing is the primary means of debugging a grammar or input string.\r\n  - Counting node hits serves as a type of profiling, exposing which rules are most often hit.\r\n- `./cool-app/` - A simple demonstration of parsing a string with UTF+32 (in this case emoticon) characters.\r\n- `./uri-app/` - This example builds a light-weight, but robust and well-tested URI parser.\r\n\r\nThe Node.js applications can all be run from the `package.json` scripts.\r\nUse `npm run` to see the script names of the demonstrations.\r\n\r\n### The URI Parser\r\n\r\nNote: version 1.0.5 fixes a bug in the URI grammar.\r\nThe previous versions incorrectly allowed empty strings for the IPv4 octets.\r\nNo changes to the `apg-lite` parser or any of the other examples have been made.\r\n\r\nThe `UriParser` object in the `./uri-app/` application is of special interest.\r\nIt is a fully-contained (no dependencies) [URI](https://www.rfc-editor.org/rfc/rfc3986) parser.\r\nAny URI can be parsed with, for example:\r\n\r\n> npm run uri -- http://user@example.com\r\n\r\nIf no argument is given, the example will parse a pre-chosen representive URI.\r\n\r\n`UriParser` is well-tested with [Jest](https://jestjs.io/) unit tests in the `__tests__` directory.\r\n\r\n> npm test\r\n\r\nwill run all of the unit tests.\r\n\r\nSee `./uri-app/documentation.md` for complete documentation.\r\nSee `./uri-app/node-app.js` for a sample Node.js application\r\nand `./uri-app/web.html` for sample web page application.","users":{}}