{"_id":"regexparam","_rev":"4019482","name":"regexparam","description":"A tiny (399B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"time":{"modified":"2025-09-01T02:36:02.000Z","created":"2018-04-08T07:29:22.984Z","3.0.0":"2023-12-03T21:39:17.686Z","2.0.2":"2023-12-03T20:55:11.493Z","2.0.1":"2022-07-02T15:01:37.254Z","2.0.0":"2021-05-25T00:17:47.557Z","1.3.0":"2019-07-09T02:49:58.218Z","1.2.2":"2019-06-22T21:48:00.015Z","1.2.1":"2019-03-12T18:04:52.264Z","1.2.0":"2019-03-10T00:00:17.424Z","1.1.1":"2019-03-09T23:09:42.289Z","1.1.0":"2019-03-09T17:38:20.079Z","1.0.2":"2018-12-24T10:34:48.723Z","1.0.1":"2018-04-13T04:11:48.452Z","1.0.0":"2018-04-09T20:53:31.859Z","0.0.1":"2018-04-08T22:19:10.568Z","0.0.0":"2018-04-08T07:29:22.984Z"},"users":{},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"versions":{"3.0.0":{"name":"regexparam","version":"3.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (399B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=8"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["regexp","route","routing","inject","parse"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"_id":"regexparam@3.0.0","gitHead":"d05da2631beb7c5620774dae207cb09c7cbf24cc","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"shasum":"1673e09d41cb7fd41eaafd4040a6aa90daa0a21a","size":5575,"noattachment":false,"key":"/regexparam/-/regexparam-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-3.0.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_3.0.0_1701639557525_0.8326465373123788"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-03T21:39:17.686Z","publish_time":1701639557686,"_source_registry_name":"default","_cnpm_publish_time":1701639557686},"2.0.2":{"name":"regexparam","version":"2.0.2","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (394B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=8"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["regexp","route","routing","inject","parse"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"_id":"regexparam@2.0.2","gitHead":"5290e8711b09a1a87763f7beeef44e299b23f7b3","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"shasum":"a0f6aa057c67b1c9c09508c45823c0755b1f6e58","size":5457,"noattachment":false,"key":"/regexparam/-/regexparam-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-2.0.2.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_2.0.2_1701636911327_0.6527238570177427"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-03T20:55:11.493Z","publish_time":1701636911493,"_source_registry_name":"default","_cnpm_publish_time":1701636911493},"2.0.1":{"name":"regexparam","version":"2.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (394B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=8"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["regexp","route","routing","inject","parse"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"fff88a167de022ebccb760ce606cf13ff7ceec44","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@2.0.1","_nodeVersion":"18.3.0","_npmVersion":"8.11.0","dist":{"shasum":"c912f5dae371e3798100b3c9ce22b7414d0889fa","size":5702,"noattachment":false,"key":"/regexparam/-/regexparam-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-2.0.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_2.0.1_1656774097087_0.8957609314227224"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-02T20:19:19.783Z","publish_time":1656774097254,"_cnpm_publish_time":1656774097254},"2.0.0":{"name":"regexparam","version":"2.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (394B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=8"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["regexp","route","routing","inject","parse"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"06a5ec322be9a2bdeaa1bd2bce386f096f38f628","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@2.0.0","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"shasum":"059476767d5f5f87f735fc7922d133fd1a118c8c","size":5483,"noattachment":false,"key":"/regexparam/-/regexparam-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-2.0.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_2.0.0_1621901867387_0.7706084553932897"},"_hasShrinkwrap":false,"publish_time":1621901867557,"_cnpm_publish_time":1621901867557},"1.3.0":{"name":"regexparam","version":"1.3.0","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (308B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","unpkg":"dist/regexparam.min.js","module":"dist/regexparam.mjs","main":"dist/regexparam.js","types":"types.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"bundt","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["regexp","route","routing"],"devDependencies":{"bundt":"^0.3.0","tap-spec":"^4.1.1","tape":"^4.8.0"},"gitHead":"bcd6bb25080de388a9ca10a6c0f355de1deeb75c","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"2fe42c93e32a40eff6235d635e0ffa344b92965f","size":4398,"noattachment":false,"key":"/regexparam/-/regexparam-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.3.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.3.0_1562640598086_0.2525683944208117"},"_hasShrinkwrap":false,"publish_time":1562640598218,"_cnpm_publish_time":1562640598218},"1.2.2":{"name":"regexparam","version":"1.2.2","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (285B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.mjs","main":"dist/regexparam.js","types":"types.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"bundt","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["regexp","route","routing"],"devDependencies":{"bundt":"^0.3.0","tap-spec":"^4.1.1","tape":"^4.8.0"},"gitHead":"4e98a6f1b1b520f93020c845eb44791dea8f950e","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.2.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"76d556dce33afb4b83ea9cbee39563f4329e5b71","size":3216,"noattachment":false,"key":"/regexparam/-/regexparam-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.2.2.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.2.2_1561240079840_0.988383658485241"},"_hasShrinkwrap":false,"publish_time":1561240080015,"_cnpm_publish_time":1561240080015},"1.2.1":{"name":"regexparam","version":"1.2.1","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (285B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.mjs","main":"dist/regexparam.js","types":"types.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"bundt","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["regexp","route","routing"],"devDependencies":{"bundt":"^0.3.0","tap-spec":"^4.1.1","tape":"^4.8.0"},"gitHead":"d62dec8dc9c4a7bfe28b42f0f61196967e9496c0","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.2.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"cc2a50a987efacd328de8fa4989e3a919e6e3bab","size":3215,"noattachment":false,"key":"/regexparam/-/regexparam-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.2.1.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.2.1_1552413892041_0.8546227738223335"},"_hasShrinkwrap":false,"publish_time":1552413892264,"_cnpm_publish_time":1552413892264},"1.2.0":{"name":"regexparam","version":"1.2.0","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (285B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.mjs","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"bundt","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["regexp","route","routing"],"devDependencies":{"bundt":"^0.3.0","tap-spec":"^4.1.1","tape":"^4.8.0"},"gitHead":"c2d5b3b776b124badb0c8f3d379c445514d2c2a4","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"c447c5c947ea2c823669c0578d3424808b84aae8","size":3087,"noattachment":false,"key":"/regexparam/-/regexparam-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.2.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.2.0_1552176017306_0.1761764256073457"},"_hasShrinkwrap":false,"publish_time":1552176017424,"_cnpm_publish_time":1552176017424},"1.1.1":{"name":"regexparam","version":"1.1.1","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (276B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.mjs","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"bundt","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["regexp","route","routing"],"devDependencies":{"bundt":"^0.3.0","tap-spec":"^4.1.1","tape":"^4.8.0"},"gitHead":"cdb9053bacd4fdb65fa5f2af123ff4e7f13f8954","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"ca5379a8b76f55e262b2b6bf168d758ba460d36d","size":2906,"noattachment":false,"key":"/regexparam/-/regexparam-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.1.1.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.1.1_1552172982137_0.8217642303004984"},"_hasShrinkwrap":false,"publish_time":1552172982289,"_cnpm_publish_time":1552172982289},"1.1.0":{"name":"regexparam","version":"1.1.0","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (285B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.mjs","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"bundt","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["regexp","route","routing"],"devDependencies":{"bundt":"^0.3.0","tap-spec":"^4.1.1","tape":"^4.8.0"},"gitHead":"a44763d90f6e8f2f5ad8f59e7d3e2c413121da00","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"ddeb4ee8921dbf6d87eb92b2c1a764cc4e9370dc","size":2922,"noattachment":false,"key":"/regexparam/-/regexparam-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.1.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.1.0_1552153099950_0.3347299574317273"},"_hasShrinkwrap":false,"publish_time":1552153100079,"_cnpm_publish_time":1552153100079},"1.0.2":{"name":"regexparam","version":"1.0.2","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (252B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.mjs","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["regexp","route","routing"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","tap-spec":"^4.1.1","tape":"^4.8.0","terser":"^3.13.1"},"gitHead":"814bf32f3251735c909793d8bdd6fa5d78751f50","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"5b549be75bcf5480f5aaf927762621b1dbb074ff","size":2782,"noattachment":false,"key":"/regexparam/-/regexparam-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.0.2.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.0.2_1545647688598_0.47168253130057924"},"_hasShrinkwrap":false,"publish_time":1545647688723,"_cnpm_publish_time":1545647688723},"1.0.1":{"name":"regexparam","version":"1.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (299B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.es.js","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"files":["dist"],"keywords":["regexp","route","routing"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-es":"^3.3.9"},"gitHead":"56bdba1ea253b9b9af0046e5439d5d26fff4779f","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"b59c49b49deccf6d5031cb0ab7a36207b73ac3f4","size":2897,"noattachment":false,"key":"/regexparam/-/regexparam-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.0.1.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.0.1_1523592708373_0.7013753992316416"},"_hasShrinkwrap":false,"publish_time":1523592708452,"_cnpm_publish_time":1523592708452},"1.0.0":{"name":"regexparam","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (299B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.es.js","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"files":["dist"],"keywords":["regexp","route","routing"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-es":"^3.3.9"},"gitHead":"3b109feebe58166c47933c41c1e0814a68efc3c5","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"00b6678f4123f7c9a1caf82bb8280d7fc62526bc","size":2869,"noattachment":false,"key":"/regexparam/-/regexparam-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-1.0.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_1.0.0_1523307211808_0.21608703669799434"},"_hasShrinkwrap":false,"publish_time":1523307211859,"_cnpm_publish_time":1523307211859},"0.0.1":{"name":"regexparam","version":"0.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"A tiny (299B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍","module":"dist/regexparam.es.js","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"files":["dist"],"keywords":["regexp","route","routing"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-es":"^3.3.9"},"gitHead":"2bb19b2484488ff1e4828f7107f9e364cd5474dd","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@0.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"bb1ee6ba527043d689cbe057089db71f025a902e","size":2870,"noattachment":false,"key":"/regexparam/-/regexparam-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-0.0.1.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_0.0.1_1523225950486_0.6756384128591217"},"_hasShrinkwrap":false,"publish_time":1523225950568,"_cnpm_publish_time":1523225950568},"0.0.0":{"name":"regexparam","version":"0.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/regexparam.git"},"description":"WIP","module":"dist/regexparam.es.js","main":"dist/regexparam.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=6"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"files":["dist"],"keywords":[],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-js":"^3.2.0"},"bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"homepage":"https://github.com/lukeed/regexparam#readme","_id":"regexparam@0.0.0","_shasum":"bec0d7a8949faed0a4114766715a2e3b74266ad7","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"bec0d7a8949faed0a4114766715a2e3b74266ad7","size":1131,"noattachment":false,"key":"/regexparam/-/regexparam-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regexparam/download/regexparam-0.0.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexparam_0.0.0_1523172562874_0.6315737969420201"},"_hasShrinkwrap":false,"publish_time":1523172562984,"_cnpm_publish_time":1523172562984}},"readme":"# regexparam [![CI](https://github.com/lukeed/regexparam/actions/workflows/ci.yml/badge.svg)](https://github.com/lukeed/regexparam/actions/workflows/ci.yml)\n\n> A tiny (399B) utility that converts route patterns into RegExp. Limited alternative to [`path-to-regexp`](https://github.com/pillarjs/path-to-regexp) ????\n\nWith `regexparam`, you may turn a pathing string (eg, `/users/:id`) into a regular expression.\n\nAn object with shape of `{ keys, pattern }` is returned, where `pattern` is the `RegExp` and `keys` is an array of your parameter name(s) in the order that they appeared.\n\nUnlike [`path-to-regexp`](https://github.com/pillarjs/path-to-regexp), this module does not create a `keys` dictionary, nor mutate an existing variable. Also, this only ships a parser, which only accept strings. Similarly, and most importantly, `regexparam` **only** handles basic pathing operators:\n\n* Static (`/foo`, `/foo/bar`)\n* Parameter (`/:title`, `/books/:title`, `/books/:genre/:title`)\n* Parameter w/ Suffix (`/movies/:title.mp4`, `/movies/:title.(mp4|mov)`)\n* Optional Parameters (`/:title?`, `/books/:title?`, `/books/:genre/:title?`)\n* Wildcards (`*`, `/books/*`, `/books/:genre/*`)\n* Optional Wildcard (`/books/*?`)\n\nThis module exposes three module definitions:\n\n* **CommonJS**: [`dist/index.js`](https://unpkg.com/regexparam/dist/index.js)\n* **ESModule**: [`dist/index.mjs`](https://unpkg.com/regexparam/dist/index.mjs)\n* **UMD**: [`dist/index.min.js`](https://unpkg.com/regexparam/dist/index.min.js)\n\n## Install\n\n```\n$ npm install --save regexparam\n```\n\n\n## Usage\n\n```js\nimport { parse, inject } from 'regexparam';\n\n// Example param-assignment\nfunction exec(path, result) {\n  let i=0, out={};\n  let matches = result.pattern.exec(path);\n  while (i < result.keys.length) {\n    out[ result.keys[i] ] = matches[++i] || null;\n  }\n  return out;\n}\n\n\n// Parameter, with Optional Parameter\n// ---\nlet foo = parse('/books/:genre/:title?')\n// foo.pattern => /^\\/books\\/([^\\/]+?)(?:\\/([^\\/]+?))?\\/?$/i\n// foo.keys => ['genre', 'title']\n\nfoo.pattern.test('/books/horror'); //=> true\nfoo.pattern.test('/books/horror/goosebumps'); //=> true\n\nexec('/books/horror', foo);\n//=> { genre: 'horror', title: null }\n\nexec('/books/horror/goosebumps', foo);\n//=> { genre: 'horror', title: 'goosebumps' }\n\n\n// Parameter, with suffix\n// ---\nlet bar = parse('/movies/:title.(mp4|mov)');\n// bar.pattern => /^\\/movies\\/([^\\/]+?)\\.(mp4|mov)\\/?$/i\n// bar.keys => ['title']\n\nbar.pattern.test('/movies/narnia'); //=> false\nbar.pattern.test('/movies/narnia.mp3'); //=> false\nbar.pattern.test('/movies/narnia.mp4'); //=> true\n\nexec('/movies/narnia.mp4', bar);\n//=> { title: 'narnia' }\n\n\n// Wildcard\n// ---\nlet baz = parse('users/*');\n// baz.pattern => /^\\/users\\/(.*)\\/?$/i\n// baz.keys => ['*']\n\nbaz.pattern.test('/users'); //=> false\nbaz.pattern.test('/users/lukeed'); //=> true\nbaz.pattern.test('/users/'); //=> true\n\n\n// Optional Wildcard\n// ---\nlet baz = parse('/users/*?');\n// baz.pattern => /^\\/users(?:\\/(.*))?(?=$|\\/)/i\n// baz.keys => ['*']\n\nbaz.pattern.test('/users'); //=> true\nbaz.pattern.test('/users/lukeed'); //=> true\nbaz.pattern.test('/users/'); //=> true\n\n\n// Injecting\n// ---\n\ninject('/users/:id', {\n  id: 'lukeed'\n}); //=> '/users/lukeed'\n\ninject('/movies/:title.mp4', {\n  title: 'narnia'\n}); //=> '/movies/narnia.mp4'\n\ninject('/:foo/:bar?/:baz?', {\n  foo: 'aaa'\n}); //=> '/aaa'\n\ninject('/:foo/:bar?/:baz?', {\n  foo: 'aaa',\n  baz: 'ccc'\n}); //=> '/aaa/ccc'\n\ninject('/posts/:slug/*', {\n  slug: 'hello',\n}); //=> '/posts/hello'\n\ninject('/posts/:slug/*', {\n  slug: 'hello',\n  '*': 'x/y/z',\n}); //=> '/posts/hello/x/y/z'\n\n// Missing non-optional value\n// ~> keeps the pattern in output\ninject('/hello/:world', {\n  abc: 123\n}); //=> '/hello/:world'\n```\n\n> **Important:** When matching/testing against a generated RegExp, your path **must** begin with a leading slash (`\"/\"`)!\n\n## Regular Expressions\n\nFor fine-tuned control, you may pass a `RegExp` value directly to `regexparam` as its only parameter.\n\nIn these situations, `regexparam` **does not** parse nor manipulate your pattern in any way! Because of this, `regexparam` has no \"insight\" on your route, and instead trusts your input fully. In code, this means that the return value's `keys` is always equal to `false` and the `pattern` is identical to your input value.\n\nThis also means that you must manage and parse your own `keys`~!<br>\nYou may use [named capture groups](https://javascript.info/regexp-groups#named-groups) or traverse the matched segments manually the \"old-fashioned\" way:\n\n> **Important:** Please check your target browsers' and target [Node.js runtimes' support](https://node.green/#ES2018-features--RegExp-named-capture-groups)!\n\n```js\n// Named capture group\nconst named = regexparam.parse(/^\\/posts[/](?<year>[0-9]{4})[/](?<month>[0-9]{2})[/](?<title>[^\\/]+)/i);\nconst { groups } = named.pattern.exec('/posts/2019/05/hello-world');\nconsole.log(groups);\n//=> { year: '2019', month: '05', title: 'hello-world' }\n\n// Widely supported / \"Old-fashioned\"\nconst named = regexparam.parse(/^\\/posts[/]([0-9]{4})[/]([0-9]{2})[/]([^\\/]+)/i);\nconst [url, year, month, title] = named.pattern.exec('/posts/2019/05/hello-world');\nconsole.log(year, month, title);\n//=> 2019 05 hello-world\n```\n\n\n## API\n\n### regexparam.parse(input: RegExp)\n### regexparam.parse(input: string, loose?: boolean)\nReturns: `Object`\n\nParse a route pattern into an equivalent RegExp pattern. Also collects the names of pattern's parameters as a `keys` array. An `input` that's already a RegExp is kept as is, and `regexparam` makes no additional insights.\n\nReturns a `{ keys, pattern }` object, where `pattern` is always a `RegExp` instance and `keys` is either `false` or a list of extracted parameter names.\n\n> **Important:** The `keys` will _always_ be `false` when `input` is a RegExp and it will _always_ be an Array when `input` is a string.\n\n#### input\nType: `string` or `RegExp`\n\nWhen `input` is a string, it's treated as a route pattern and an equivalent RegExp is generated.\n\n> **Note:** It does not matter if `input` strings begin with a `/` &mdash; it will be added if missing.\n\nWhen `input` is a RegExp, it will be used **as is** – no modifications will be made.\n\n#### loose\nType: `boolean`<br>\nDefault: `false`\n\nShould the `RegExp` match URLs that are longer than the [`str`](#str) pattern itself?<br>\nBy default, the generated `RegExp` will test that the URL begins and _ends with_ the pattern.\n\n> **Important:** When `input` is a RegExp, the `loose` argument is ignored!\n\n```js\nconst { parse } = require('regexparam');\n\nparse('/users').pattern.test('/users/lukeed'); //=> false\nparse('/users', true).pattern.test('/users/lukeed'); //=> true\n\nparse('/users/:name').pattern.test('/users/lukeed/repos'); //=> false\nparse('/users/:name', true).pattern.test('/users/lukeed/repos'); //=> true\n```\n\n\n### regexparam.inject(pattern: string, values: object)\nReturns: `string`\n\nReturns a new string by replacing the `pattern` segments/parameters with their matching values.\n\n> **Important:** Named segments (eg, `/:name`) that _do not_ have a `values` match will be kept in the output. This is true _except for_ optional segments (eg, `/:name?`) and wildcard segments (eg, `/*`).\n\n#### pattern\nType: `string`\n\nThe route pattern that to receive injections.\n\n#### values\nType: `Record<string, string>`\n\nThe values to be injected. The keys within `values` must match the `pattern`'s segments in order to be replaced.\n\n> **Note:** To replace a wildcard segment (eg, `/*`), define a `values['*']` key.\n\n\n## Deno\n\nAs of version `1.3.0`, you may use `regexparam` with Deno. These options are all valid:\n\n```ts\n// The official Deno registry:\nimport regexparam from 'https://deno.land/x/regexparam/src/index.js';\n// Third-party CDNs with ESM support:\nimport regexparam from 'https://cdn.skypack.dev/regexparam';\nimport regexparam from 'https://esm.sh/regexparam';\n```\n\n> **Note:** All registries support versioned URLs, if desired. <br>The above examples always resolve to the latest published version.\n\n\n## Related\n\n- [trouter](https://github.com/lukeed/trouter) - A server-side HTTP router that extends from this module.\n- [matchit](https://github.com/lukeed/matchit) - Similar (650B) library, but relies on String comparison instead of `RegExp`s.\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","_attachments":{},"homepage":"https://github.com/lukeed/regexparam#readme","bugs":{"url":"https://github.com/lukeed/regexparam/issues"},"license":"MIT"}