{"_id":"uri-templates","_rev":"4579102","name":"uri-templates","description":"URI Templates (RFC6570) including de-substitution","dist-tags":{"latest":"0.2.0"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"time":{"modified":"2026-04-10T15:53:03.000Z","created":"2013-08-10T09:30:22.090Z","0.2.0":"2016-05-29T16:06:19.965Z","0.1.9":"2015-10-02T19:14:30.793Z","0.1.8":"2015-09-30T17:01:11.826Z","0.1.7":"2015-04-07T14:06:39.126Z","0.1.6":"2015-04-07T13:47:02.548Z","0.1.5":"2014-06-04T13:17:29.030Z","0.1.4":"2014-06-04T13:09:36.404Z","0.1.2":"2013-09-24T16:01:58.840Z","0.1.1":"2013-08-10T11:42:18.187Z","0.1.0":"2013-08-10T09:30:22.090Z"},"users":{},"author":{"name":"Geraint Luff"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"versions":{"0.2.0":{"name":"uri-templates","version":"0.2.0","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"mocha --bail"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"_id":"uri-templates@0.2.0","_shasum":"2b5784511cc909868731e9233c268097d10b499f","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"dist":{"shasum":"2b5784511cc909868731e9233c268097d10b499f","size":43773,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.2.0.tgz"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/uri-templates-0.2.0.tgz_1464537977963_0.9199858594220132"},"directories":{},"publish_time":1464537979965,"_hasShrinkwrap":false,"_cnpm_publish_time":1464537979965,"_cnpmcore_publish_time":"2021-12-16T21:35:52.731Z"},"0.1.9":{"name":"uri-templates","version":"0.1.9","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"_id":"uri-templates@0.1.9","_shasum":"c56f7a5731b3a310226695f6e5639180fd1aa249","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"dist":{"shasum":"c56f7a5731b3a310226695f6e5639180fd1aa249","size":45935,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.9.tgz"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1443813270793,"_hasShrinkwrap":false,"_cnpm_publish_time":1443813270793,"_cnpmcore_publish_time":"2021-12-16T21:35:53.001Z"},"0.1.8":{"name":"uri-templates","version":"0.1.8","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"_id":"uri-templates@0.1.8","_shasum":"a243b0ec4cfc124adf941d36656952c3b4861b0d","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"dist":{"shasum":"a243b0ec4cfc124adf941d36656952c3b4861b0d","size":45717,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.8.tgz"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1443632471826,"_hasShrinkwrap":false,"_cnpm_publish_time":1443632471826,"_cnpmcore_publish_time":"2021-12-16T21:35:53.330Z"},"0.1.7":{"name":"uri-templates","version":"0.1.7","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"homepage":"https://github.com/geraintluff/uri-templates","_id":"uri-templates@0.1.7","dist":{"shasum":"d55be3bd4cc7773b9a909304c87cfd0b3cd9e5af","size":45732,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.7.tgz"},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1428415599126,"_hasShrinkwrap":false,"_cnpm_publish_time":1428415599126,"_cnpmcore_publish_time":"2021-12-16T21:35:53.606Z"},"0.1.6":{"name":"uri-templates","version":"0.1.6","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"homepage":"https://github.com/geraintluff/uri-templates","_id":"uri-templates@0.1.6","dist":{"shasum":"727b72b09ebf8564734b16cf1efd5a534e5d9bdf","size":45604,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.6.tgz"},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1428414422548,"_hasShrinkwrap":false,"_cnpm_publish_time":1428414422548,"_cnpmcore_publish_time":"2021-12-16T21:35:54.067Z"},"0.1.5":{"name":"uri-templates","version":"0.1.5","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"homepage":"https://github.com/geraintluff/uri-templates","_id":"uri-templates@0.1.5","dist":{"shasum":"4d3a73fe6f0c4de113f2c90b9d7a3cc323b770ae","size":45182,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.5.tgz"},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1401887849030,"_hasShrinkwrap":false,"_cnpm_publish_time":1401887849030,"_cnpmcore_publish_time":"2021-12-16T21:35:54.377Z"},"0.1.4":{"name":"uri-templates","version":"0.1.4","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"homepage":"https://github.com/geraintluff/uri-templates","_id":"uri-templates@0.1.4","dist":{"shasum":"930de2cbf65546b7cc969e68a00797caf1f4acc8","size":45116,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.4.tgz"},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1401887376404,"_hasShrinkwrap":false,"_cnpm_publish_time":1401887376404,"_cnpmcore_publish_time":"2021-12-16T21:35:54.720Z"},"0.1.2":{"name":"uri-templates","version":"0.1.2","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","readmeFilename":"README.md","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"_id":"uri-templates@0.1.2","dist":{"shasum":"7f72ec3edd47de0e9fd8e831c7d780021a339b92","size":41612,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.2.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1380038518840,"_hasShrinkwrap":false,"_cnpm_publish_time":1380038518840,"_cnpmcore_publish_time":"2021-12-16T21:35:54.980Z"},"0.1.1":{"name":"uri-templates","version":"0.1.1","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","readmeFilename":"README.md","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","devDependencies":{"grunt":"~0.4.1","grunt-contrib-clean":"~0.4.1","grunt-contrib-jshint":"~0.6.0","mocha":"~1.11.0","grunt-mocha":"~0.3.4","grunt-mocha-test":"~0.5.0","grunt-cli":"~0.1.9","grunt-contrib-uglify":"~0.2.2","grunt-contrib-copy":"~0.4.1","proclaim":"1.4","mocha-unfunk-reporter":"~0.2","jshint-path-reporter":"~0.1","grunt-concat-sourcemap":"~0.2","source-map-support":"~0.1","grunt-markdown":"~0.3.0"},"_id":"uri-templates@0.1.1","dist":{"shasum":"8ed03a024cf8f8415284375868c8b3646d2d41d0","size":41269,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.1.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1376134938187,"_hasShrinkwrap":false,"_cnpm_publish_time":1376134938187,"_cnpmcore_publish_time":"2021-12-16T21:35:55.277Z"},"0.1.0":{"name":"uri-templates","version":"0.1.0","description":"URI Templates (RFC6570) including de-substitution","main":"uri-templates.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/geraintluff/uri-templates.git"},"keywords":["rfc6570","uri","template"],"author":{"name":"Geraint Luff"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt","readmeFilename":"README.md","gitHead":"3c65c2e1809e8c0dca1fb6b440c18fbc7acd85da","_id":"uri-templates@0.1.0","dist":{"shasum":"7bd9654024b2b2e8b343ae5ebeab862c11abbabb","size":3417,"noattachment":false,"key":"/uri-templates/-/uri-templates-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uri-templates/download/uri-templates-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"},"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"directories":{},"publish_time":1376127022090,"_hasShrinkwrap":false,"_cnpm_publish_time":1376127022090,"_cnpmcore_publish_time":"2021-12-16T21:35:55.499Z"}},"readme":"# uri-templates\n\nURI Templates ([RFC6570](http://tools.ietf.org/html/rfc6570)) in JavaScript, including de-substitution.\n\nIt is tested against the [official test suite](https://github.com/uri-templates/uritemplate-test), including the extended tests.\n\nThe \"de-substitution\" extracts parameter values from URIs.  It is also tested against the official test suite (including extended tests).\n\n## Creation\n\nIn Node:\n```javascript\nvar uriTemplates = require('uri-templates');\nvar template1 = uriTemplates(\"/date/{colour}/{shape}/\");\n```\n\nIn browser:\n```javascript\nvar template2 = new UriTemplate(\"/prefix/{?params*}\");\n```\n\n## Substitution using an object\n```javascript\n// \"/categories/green/round/\"\nvar uri1 = template1.fill({colour: \"green\", shape: \"round\"});\n\n// \"/prefix/?a=A&b=B&c=C\nvar uri2 = template2.fillFromObject({\n\tparams: {a: \"A\", b: \"B\", c: \"C\"}\n});\n```\n\n## Substitution using a callback\n```javascript\n// \"/categories/example_colour/example_shape/\"\nvar uri1b = template1.fill(function (varName) {\n\treturn \"example_\" + varName;\n});\n```\n\n## Guess variables from URI (\"de-substitution\")\n\n```javascript\nvar uri2b = \"/prefix/?beep=boop&bleep=bloop\";\nvar params = template2.fromUri(url2b);\n/*\n\t{\n\t\tparams: {\n\t\t\tbeep: \"boop\",\n\t\t\tbleep: \"bloop\"\n\t\t}\n\t}\n*/\n```\n\nWhile templates can be ambiguous (e.g. `\"{var1}{var2}\"`), it will still produce *something* that reconstructs into the original URI.\n\nIt can handle all the cases in the official test suite, including the extended tests:\n\n```javascript\nvar template = uriTemplate(\"{/id*}{?fields,token}\");\n\nvar values = template.fromUri(\"/person/albums?fields=id,name,picture&token=12345\");\n/*\n{\n\tid: [\"person\", 'albums\"],\n\tfields: [\"id\", \"name\", \"picture\"],\n\ttoken: \"12345\"\n}\n*/\n```\n\n### `strict` option\n\nSometimes, you might want a more exact match, instead of a best guess.  For example, this could be useful when using URI Templates for routing.\n\nThe `strict` option performs more checks, to see whether the URI being matched is plausible:\n\n```javascript\nvar template = uriTemplate(\"/prefix/{value}/{suffix}\");\n\n// Matches, even though \"foo/bar\" contains a \"/\" which is not allowed\nvar looseMatch = template.fromUri('/prefix/foo/bar/suffix');\n// Does not match\nvar strictMatch = template.fromUri('/prefix/foo/bar/suffix', {strict: true});\n\n```\n\n## Test URI\n\n```javascript\nvar uri2b = \"/prefix/?beep=boop&bleep=bloop\";\nvar isMatch = template2.test(url2b); // === true\n```\n\nThis returns a boolean, and takes the same options as `.fromUri()`.\n\n## License\n\nThis project is released as [public-domain](http://geraintluff.github.io/tv4/LICENSE.txt).  Anybody can modify or re-license it for any purpose, without restriction.\n","_attachments":{},"bugs":{"url":"https://github.com/geraintluff/uri-templates/issues"},"license":"http://geraintluff.github.io/tv4/LICENSE.txt"}