{"versions":{"1.0.0":{"name":"graphmatch","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/graphmatch.git"},"description":"A low-level utility for matching a string against a directed acyclic graph of regexes.","version":"1.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["regex","regexp","dag","graph","match"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.5","tsex":"^4.0.2","typescript":"^5.9.3"},"dependencies":{"lodash":"^4.17.21"},"_id":"graphmatch@1.0.0","gitHead":"c033a3fbf24ecc7653f897bb6ffb123c331a5a7a","bugs":{"url":"https://github.com/fabiospampinato/graphmatch/issues"},"homepage":"https://github.com/fabiospampinato/graphmatch#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-k/8DQYp7atBb3WsAErBMUEcALBxq6Lvhl1eg9VuwlxpWq22EpbgcL9vxcJrDt+bv10FMHQR2Ew0hsDJ/iPWaUw==","shasum":"4444649192253e1a0f563132e3a812460c48521b","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/graphmatch/-/graphmatch-1.0.0.tgz","fileCount":10,"unpackedSize":9603,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHcZN32jSg8CdL8a2A/tm3bGNo5Mw+AA3x+ZHloVjZfjAiB+vsHAv6VDa1Y30MKJq9DO8uGwGByLI4/FHyeldW5N+A=="}],"size":2983},"_npmUser":{"name":"anonymous","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/graphmatch_1.0.0_1760210437987_0.7172062144756117"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-11T19:20:38.165Z","publish_time":1760210438165,"_source_registry_name":"default","contributors":[]},"1.0.1":{"name":"graphmatch","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/graphmatch.git"},"description":"A low-level utility for matching a string against a directed acyclic graph of regexes.","version":"1.0.1","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["regex","regexp","dag","graph","match"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.5","tsex":"^4.0.2","typescript":"^5.9.3"},"_id":"graphmatch@1.0.1","gitHead":"2cd0489382332d02f08d85e5c3000c562317966a","bugs":{"url":"https://github.com/fabiospampinato/graphmatch/issues"},"homepage":"https://github.com/fabiospampinato/graphmatch#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-PK++Ebrk4O/w6OUpAUA/mmRcXuXCtIjRlsNBIJE8+XM+5mfr0UctGAD741tuJpY2crjHFku86oudi1o9YYo/FQ==","shasum":"5139a89b75c7b345eba5798444960c0c1ce15b80","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/graphmatch/-/graphmatch-1.0.1.tgz","fileCount":10,"unpackedSize":9553,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC3T0dPzg8wFcmL11LHR0BKE8VqwAU1T2hJBzIDWR35kAIgceP674N8H6X7dtQO+ztCf98VXBqcyS7S/3SFjSznvzI="}],"size":2967},"_npmUser":{"name":"anonymous","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/graphmatch_1.0.1_1760210469331_0.5671029865726829"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-11T19:21:09.563Z","publish_time":1760210469563,"_source_registry_name":"default","contributors":[]},"1.0.2":{"name":"graphmatch","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/graphmatch.git"},"description":"A low-level utility for matching a string against a directed acyclic graph of regexes.","version":"1.0.2","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["regex","regexp","dag","graph","match"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.5","tsex":"^4.0.2","typescript":"^5.9.3"},"_id":"graphmatch@1.0.2","gitHead":"4f7cbc20cdcc0f55d81b973f2ccc9132a1267bd0","bugs":{"url":"https://github.com/fabiospampinato/graphmatch/issues"},"homepage":"https://github.com/fabiospampinato/graphmatch#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-QcqjrGYos1NAMjFFsBvpWtZk11H8pAOWy5bFafwcTNo/fiiTvN6WzKfGpWyE8DZaZcxQaf28XC4ksLO4WJqCdA==","shasum":"b0a4c80ec14057290509e083190dad9a747876db","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/graphmatch/-/graphmatch-1.0.2.tgz","fileCount":9,"unpackedSize":8142,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCTrHo4NMVQuaJ4LquSkstOX/TnN1i1zVfrYwjxDIdRuQIhAP6sG3ebY4E8q/toBHNcqrJizdY6UP7TolLH8+M633z7"}],"size":3076},"_npmUser":{"name":"anonymous","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/graphmatch_1.0.2_1760876999217_0.6179548192822302"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-19T12:29:59.412Z","publish_time":1760876999412,"_source_registry_name":"default","contributors":[]},"1.1.0":{"name":"graphmatch","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/graphmatch.git"},"description":"A low-level utility for matching a string against a directed acyclic graph of regexes.","version":"1.1.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["regex","regexp","dag","graph","match"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.5","tsex":"^4.0.2","typescript":"^5.9.3"},"_id":"graphmatch@1.1.0","gitHead":"0b88304dd91cf9d058fb0743fe0ccd41d637a006","bugs":{"url":"https://github.com/fabiospampinato/graphmatch/issues"},"homepage":"https://github.com/fabiospampinato/graphmatch#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-0E62MaTW5rPZVRLyIJZG/YejmdA/Xr1QydHEw3Vt+qOKkMIOE8WDLc9ZX2bmAjtJFZcId4lEdrdmASsEy7D1QA==","shasum":"1a943a42a4f2c8290d56fba22247483dda4fb3c9","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/graphmatch/-/graphmatch-1.1.0.tgz","fileCount":9,"unpackedSize":9312,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQClMRRl9+pX5QSwanRnZYeUXCoLY72/LblHv1R2sMO2PAIgVhau8bxG2USXJUW3afZcpHLmvR2Li39X9KANGeLXmdg="}],"size":3449},"_npmUser":{"name":"anonymous","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/graphmatch_1.1.0_1760898190267_0.47794095502990874"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-19T18:23:10.448Z","publish_time":1760898190448,"_source_registry_name":"default","contributors":[]},"1.1.1":{"name":"graphmatch","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/graphmatch.git"},"description":"A low-level utility for matching a string against a directed acyclic graph of regexes.","license":"MIT","version":"1.1.1","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["regex","regexp","dag","graph","match"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.5","tsex":"^4.0.2","typescript":"^5.9.3"},"_id":"graphmatch@1.1.1","gitHead":"52d30409dc885d88042954184090629b314e6c88","bugs":{"url":"https://github.com/fabiospampinato/graphmatch/issues"},"homepage":"https://github.com/fabiospampinato/graphmatch#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-5ykVn/EXM1hF0XCaWh05VbYvEiOL2lY1kBxZtaYsyvjp7cmWOU1XsAdfQBwClraEofXDT197lFbXOEVMHpvQOg==","shasum":"dcec68e8cb74de0a372d5252fc06e241daf71c38","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/graphmatch/-/graphmatch-1.1.1.tgz","fileCount":9,"unpackedSize":9332,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICmLNwkOQVlUWfCCi7roN3lYg/868s+FO0oih8b8He7NAiEA/KGBHfrMyve/Xd2ir9R/VLtRRM7zyQYHcymgmZ9MQ7s="}],"size":3455},"_npmUser":{"name":"anonymous","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/graphmatch_1.1.1_1771084746393_0.8101614846650373"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-14T15:59:06.563Z","publish_time":1771084746563,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.1.1"},"name":"graphmatch","time":{"created":"2025-10-11T19:20:49.839Z","modified":"2026-02-14T15:59:17.450Z","1.0.0":"2025-10-11T19:20:38.165Z","1.0.1":"2025-10-11T19:21:09.563Z","1.0.2":"2025-10-19T12:29:59.412Z","1.1.0":"2025-10-19T18:23:10.448Z","1.1.1":"2026-02-14T15:59:06.563Z"},"readme":"# Graphmatch\n\nA low-level utility for matching a string against a directed acyclic graph of regexes.\n\n- It supports matching strings partially too.\n- It supports fine-grained control over which nodes in the graph can be matched partially or not.\n- It supports compiling the whole graph to a regex, even for partial matches.\n- The graph will always be matched against the input string from the very start.\n- RegExp flags are supported as long as they are the same for all the regexes in the graph.\n\n## Install\n\n```sh\nnpm install graphmatch\n```\n\n## Usage\n\n```ts\nimport graphmatch from 'graphmatch';\n\n// Let's say we would like to match against this glob: foo/{bar,baz}/qux\n// Let's express that as a graph of regexes that this library can match against\n// Whether you reuse the \"qux\" node or not doesn't matter, both are supported\n\nconst GRAPH = {\n  regex: /foo/,\n  children: [\n    {\n      regex: /\\//,\n      children: [\n        {\n          regex: /bar/,\n          children: [\n            {\n              regex: /\\//,\n              children: [\n                {\n                  regex: /qux/\n                }\n              ]\n            }\n          ]\n        },\n        {\n          regex: /baz/,\n          children: [\n            {\n              regex: /\\//,\n              children: [\n                {\n                  regex: /qux/\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n};\n\n// Let's now match against the graph, fully\n\ngraphmatch ( GRAPH, 'foo/bar/qux' ); // => true\ngraphmatch ( GRAPH, 'foo/baz/qux' ); // => true\n\ngraphmatch ( GRAPH, 'foo/bar/whoops' ); // => false\ngraphmatch ( GRAPH, 'foo/baz' ); // => false\n\n// Let's now match against the graph, partially\n// A partial match happens when any node in the graph sees the end of the string, either before or after the node's regex is executed\n\ngraphmatch ( GRAPH, 'foo/bar/qux', { partial: true } ); // => true\ngraphmatch ( GRAPH, 'foo/bar/', { partial: true } ); // => true\ngraphmatch ( GRAPH, 'foo/bar', { partial: true } ); // => true\ngraphmatch ( GRAPH, 'foo/', { partial: true } ); // => true\ngraphmatch ( GRAPH, 'foo', { partial: true } ); // => true\n\ngraphmatch ( GRAPH, 'foo/bar/whoops', { partial: true } ); // => false\ngraphmatch ( GRAPH, 'foo/barsomething', { partial: true } ); // => false\ngraphmatch ( GRAPH, 'bar', { partial: true } ); // => false\n\n// As we just saw partial matching is set to \"false\" by default, and there is an option to set it to \"true\" by default\n// But you can also decide on a node-by-node basis whether partial matching should be enabled or disabled for that particular node\n// A partial node will match if the whole input string has been consumed, right before or after the node's regex is executed\n// This has higher priority compared to the global setting\n// This is useful for fine-grained control over which nodes can be matched partially\n\nconst NODE_NEVER_PARTIAL = { // This node will never match partially\n  partial: false,\n  regex: /foo/,\n  children: [],\n};\n\nconst NODE_ALWAYS_PARTIAL = { // This node will always match partially\n  partial: true,\n  regex: /foo/,\n  children: [],\n};\n\n// Let's now compile the whole graph to a single regex\n// This is useful if you expect to match against the graph multiple times\n// It's faster to compile the graph once and match against it multiple times\n\nconst fullRe = graphmatch.compile ( GRAPH ); // => RegExp\n\nfullRe.test ( 'foo/bar/qux' ); // => true\nfullRe.test ( 'foo/bar' ); // => false\n\nconst partialRe = graphmatch.compile ( GRAPH, { partial: true } ); // => RegExp\n\npartialRe.test ( 'foo/bar/qux' ); // => true\npartialRe.test ( 'foo/bar' ); // => true\n```\n\n## License\n\nMIT © Fabio Spampinato","users":{}}