{"_id":"express-map","_rev":"1673411","name":"express-map","description":"Exposes server route configuration with the client side via JavaScript","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"caridy","email":"caridy@gmail.com"},{"name":"imalberto","email":"imalberto@gmail.com"},{"name":"clarle","email":"cleung0@gmail.com"}],"time":{"modified":"2026-11-04T11:21:26.000Z","created":"2013-08-18T20:45:12.440Z","0.1.0":"2013-12-11T19:27:04.222Z","0.0.3":"2013-11-05T06:12:47.548Z","0.0.2":"2013-09-12T23:05:08.467Z","0.0.1":"2013-09-10T23:27:18.428Z","0.0.1-beta-3":"2013-08-23T22:19:06.382Z","0.0.1-beta-2":"2013-08-22T03:57:34.881Z","0.0.1-beta-1":"2013-08-18T20:45:12.440Z"},"users":{},"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"repository":{"type":"git","url":"git://github.com/yahoo/express-map.git"},"versions":{"0.1.0":{"name":"express-map","version":"0.1.0","description":"Exposes server route configuration with the client side via JavaScript","author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"homepage":"https://github.com/yahoo/express-map","contributors":[{"name":"Alberto Chan","email":"imalberto@gmail.com"},{"name":"Caridy Patino","email":"caridy@gmail.com"},{"name":"Clarence Leung","email":"cleung0@gmail.com"},{"name":"Isao Yagi","email":"isao.yagi@gmail.com"}],"main":"index.js","keywords":["config","data","expose","express","modown","routes"],"dependencies":{"express-annotations":"~0.1.0","methods":"~0.1.0"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"1.5.x","express":"3.x","express-params":"0.0.x","express-state":"1.x","express3-handlebars":"0.5.x","istanbul":"*","jshint":"*","mocha":"1.8.x","xunit-file":"*"},"repository":{"type":"git","url":"git://github.com/yahoo/express-map.git"},"bugs":{"url":"https://github.com/yahoo/express-map/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"scripts":{"test":"istanbul cover -- node_modules/mocha/bin/_mocha tests/unit/ --reporter spec","unit":"mocha tests/unit/*.js --reporter spec","lint":"jshint {.,lib,tests/unit}/*.js"},"license":"BSD","_id":"express-map@0.1.0","dist":{"shasum":"9dc74c55c1d713f8d13494c5206850e038e51159","tarball":"http://registry-npm.ywwl.com/express-map/download/express-map-0.1.0.tgz","integrity":"sha512-ZkCF5F71PF30bzDYlxsnnm49bfOZSIQJmzaHkEAZYEyjMWUNdZTMQU80K0Dq9GzkKJOXSb/fMmHvG+cx2d/P/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCawwtYi7fzEaT9OUQr5hmmQM7XCWDETxc6rS36x/WXegIhAPN3lXUN6VbDg2wSsTl0m5ykR7LInkY3F+gPOFPOoy+m"}],"size":7103,"noattachment":false,"key":"/express-map/-/express-map-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"caridy","email":"caridy@gmail.com"},{"name":"imalberto","email":"imalberto@gmail.com"},{"name":"clarle","email":"cleung0@gmail.com"}],"deprecated":"No compatible with ExpressJS 4.x Router","publish_time":1386790024222,"_cnpm_publish_time":1386790024222},"0.0.3":{"name":"express-map","version":"0.0.3","description":"Exposes server route configuration with the client side via JavaScript","author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"homepage":"https://github.com/yahoo/express-map","contributors":[{"name":"Alberto Chan","email":"imalberto@gmail.com"},{"name":"Caridy Patino","email":"caridy@gmail.com"},{"name":"Clarence Leung","email":"cleung0@gmail.com"},{"name":"Isao Yagi","email":"isao.yagi@gmail.com"}],"main":"index.js","keywords":["config","data","expose","express","modown","routes"],"dependencies":{"express-annotations":"~0.0.2","methods":"~0.1.0"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"1.5.x","express":"3.x","express-params":"0.0.x","express-state":"1.x","express3-handlebars":"0.5.x","istanbul":"*","jshint":"*","mocha":"1.8.x","xunit-file":"*"},"repository":{"type":"git","url":"git://github.com/yahoo/express-map.git"},"bugs":{"url":"https://github.com/yahoo/express-map/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"scripts":{"test":"istanbul cover -- node_modules/.bin/_mocha tests/unit/*.js --reporter spec","unit":"mocha tests/unit/*.js --reporter spec","lint":"jshint {.,lib,tests/unit}/*.js","pretest":"jshint {.,lib,tests/unit}/*.js"},"license":"BSD","_id":"express-map@0.0.3","dist":{"shasum":"cb9e12754afa9e3dd8e2df887f8e07e404d75a82","tarball":"http://registry-npm.ywwl.com/express-map/download/express-map-0.0.3.tgz","integrity":"sha512-YOBwde3oc0ztnI7z0lE0dGB02u13i0O5jIRMQEeoLcrNvpmNL3q90J0/zER4fmhFVJyNHYk82yRT7bPdIQ/wYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGb8jOhmIIOJ+8hWTRwks71Z98Ur7YlDQiUesyWUJloUAiEA/6P5z1FbQWI5m5Rlk0uIxhqQCEQd8cuqLiOu0w7LkH0="}],"size":4138,"noattachment":false,"key":"/express-map/-/express-map-0.0.3.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"caridy","email":"caridy@gmail.com"},{"name":"imalberto","email":"imalberto@gmail.com"},{"name":"clarle","email":"cleung0@gmail.com"}],"deprecated":"No compatible with ExpressJS 4.x Router","publish_time":1383631967548,"_cnpm_publish_time":1383631967548},"0.0.2":{"name":"express-map","version":"0.0.2","description":"Exposes server route configuration with the client side via JavaScript","author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"homepage":"https://github.com/yahoo/express-map","contributors":[{"name":"alberto chan","email":"imalberto@gmail.com"},{"name":"Caridy Patino","email":"caridy@gmail.com"}],"main":"index.js","keywords":["config","data","expose","express","routes"],"dependencies":{"express-annotations":"~0.0.1","methods":"~0.0.1"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"1.5.x","express":"3.x","express-params":"0.0.x","express-state":"1.x","express3-handlebars":"0.5.x","istanbul":"*","jshint":"*","mocha":"1.8.x","xunit-file":"*"},"repository":{"type":"git","url":"git://github.com/yahoo/express-map.git"},"bugs":{"url":"https://github.com/yahoo/express-map/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"scripts":{"test":"istanbul cover -- node_modules/.bin/_mocha tests/unit/*.js --reporter spec","unit":"mocha tests/unit/*.js --reporter spec","lint":"jshint {.,lib,tests/unit}/*.js"},"license":"BSD","_id":"express-map@0.0.2","dist":{"shasum":"fd747ebd4e5a06857e37d065bf657394ebc34468","tarball":"http://registry-npm.ywwl.com/express-map/download/express-map-0.0.2.tgz","integrity":"sha512-iZmaHLO7+ImWziO+awC2t0jzi/kvYVOcHVNVs3PaAX3BZ4NYLc/Yltb9LRwBdj+5a4CpdFKNWCRJOsVUSpSNoA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBEKQMHgcsGZKoIdANRudez/SHtQmvFqeHnIZcKG87dAIhAOhGH21wrpG3xNX4WdMLJF7SukXIikzbXnF6i1PyEi0l"}],"size":4065,"noattachment":false,"key":"/express-map/-/express-map-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{},"deprecated":"No compatible with ExpressJS 4.x Router","publish_time":1379027108467,"_cnpm_publish_time":1379027108467},"0.0.1":{"name":"express-map","version":"0.0.1","description":"Exposes server route configuration with the client side via JavaScript","author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"homepage":"https://github.com/yahoo/express-map","contributors":[{"name":"alberto chan","email":"imalberto@gmail.com"},{"name":"Caridy Patino","email":"caridy@gmail.com"}],"main":"index.js","scripts":{"test":"node ./node_modules/istanbul/lib/cli.js cover -- ./node_modules/mocha/bin/_mocha tests/unit/*.js --reporter spec","unit":"node ./node_modules/.bin/mocha tests/unit/*.js --reporter spec","lint":"node ./node_modules/.bin/jshint --config ./node_modules/yui-lint/jshint.json ./*.js ./tests/unit/*.js"},"keywords":["config","data","expose","express","routes"],"dependencies":{"express-annotations":"~0.0.1","methods":"~0.0.1"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"1.5.x","express":"3.x","express-params":"0.0.x","express-state":"1.x","express3-handlebars":"0.5.x","istanbul":"*","jshint":"*","yui-lint":"*","mocha":"1.8.x","xunit-file":"*"},"repository":{"type":"git","url":"git://github.com/yahoo/express-map.git"},"bugs":{"url":"https://github.com/yahoo/express-map/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"license":"BSD","_id":"express-map@0.0.1","dist":{"shasum":"e4e08a8f2644a80051415954f841c2454eab71c1","tarball":"http://registry-npm.ywwl.com/express-map/download/express-map-0.0.1.tgz","integrity":"sha512-mvTHtuTlDkHUP2ClmMfs3zqArZEnqvyBasiYxBcPHZKJitS0qKBr3c7hJR/215yxCB9N7Km6kEqbBDLhYL1PJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVrJZNJd5pJYg/+2FaK6gI8gv2wlXSKPPZhpZxW3Z1kAIhAMpO9eMIgFzRCECfBBReYPnnEhgLwZEM6Wt4jG6GQj2a"}],"size":3532,"noattachment":false,"key":"/express-map/-/express-map-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{},"deprecated":"No compatible with ExpressJS 4.x Router","publish_time":1378855638428,"_cnpm_publish_time":1378855638428},"0.0.1-beta-3":{"name":"express-map","version":"0.0.1-beta-3","description":"Exposes server route configuration with the client side via JavaScript","author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"homepage":"https://github.com/yahoo/express-map","contributors":[{"name":"alberto chan","email":"imalberto@gmail.com"},{"name":"Caridy Patino","email":"caridy@gmail.com"}],"main":"index.js","scripts":{"test":"node ./node_modules/istanbul/lib/cli.js cover -- ./node_modules/mocha/bin/_mocha tests/unit/*.js --reporter spec","unit":"node ./node_modules/.bin/mocha tests/unit/*.js --reporter spec","lint":"node ./node_modules/.bin/jshint --config ./node_modules/yui-lint/jshint.json ./*.js ./tests/unit/*.js"},"repository":"","keywords":["config","data","expose","express","routes"],"dependencies":{"express-annotations":"*"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"1.5.x","express":"3.x","express-params":"0.0.x","express-state":"1.x","express3-handlebars":"0.5.x","istanbul":"*","jshint":"*","yui-lint":"*","mocha":"1.8.x","xunit-file":"*"},"bugs":{"url":"https://github.com/yahoo/expose-routes/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"license":"BSD","_id":"express-map@0.0.1-beta-3","dist":{"shasum":"32cddc19cc54a02cb49d8088c74ff49707c18744","tarball":"http://registry-npm.ywwl.com/express-map/download/express-map-0.0.1-beta-3.tgz","integrity":"sha512-MB0u3Ev/ROzDNmcd2IDsBrSOwbjQQPmnPH+kADHAAuQaVxppMyjAK52Fk86EINdv69qumG0RhwwntHeQfKhMlw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGBgjJy6lad/4DYB22/0ySPq1iTmnJoTGnEflYmpCLYQIgWghqjo6oEsdBZPXGRku4NaKGkFDlOsooS6iIZqh+mnU="}],"size":3297,"noattachment":false,"key":"/express-map/-/express-map-0.0.1-beta-3.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{},"deprecated":"No compatible with ExpressJS 4.x Router","publish_time":1377296346382,"_cnpm_publish_time":1377296346382},"0.0.1-beta-2":{"name":"express-map","version":"0.0.1-beta-2","description":"Exposes server route configuration with the client side via JavaScript","author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"homepage":"https://github.com/yahoo/express-map","contributors":[{"name":"alberto chan","email":"imalberto@gmail.com"},{"name":"Caridy Patino","email":"caridy@gmail.com"}],"main":"index.js","scripts":{"test":"node ./node_modules/istanbul/lib/cli.js cover -- ./node_modules/mocha/bin/_mocha tests/unit/*.js --reporter spec","unit":"node ./node_modules/.bin/mocha tests/unit/*.js --reporter spec","lint":"node ./node_modules/.bin/jshint --config ./node_modules/yui-lint/jshint.json ./*.js ./tests/unit/*.js"},"repository":"","keywords":["config","data","expose","express","routes"],"dependencies":{"express-annotations":"*"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"1.5.x","express":"3.x","express-params":"0.0.x","express-state":"1.x","express3-handlebars":"0.5.x","istanbul":"*","jshint":"*","yui-lint":"*","mocha":"1.8.x","xunit-file":"*"},"bugs":{"url":"https://github.com/yahoo/expose-routes/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"license":"BSD","_id":"express-map@0.0.1-beta-2","dist":{"shasum":"7fa572e13c80fc07d758f67203d128ed37457ac5","tarball":"http://registry-npm.ywwl.com/express-map/download/express-map-0.0.1-beta-2.tgz","integrity":"sha512-rjpotUMzl9PRzAvkoHbQgb0WQyOJAnRmeqwxtxg4ZP1hKJCyzjlknJvb0PhXPwldQh2NSJzmNLTwDXSDs2SPFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdNKF6HKOvBOc80OyaeqB55VljLVPJ33FegebWC4Pe2AIhAPKIhtjHhI3OQlBqwI0Tg4x6/rfBMWCqvMhTJro+EkqI"}],"size":3148,"noattachment":false,"key":"/express-map/-/express-map-0.0.1-beta-2.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{},"deprecated":"No compatible with ExpressJS 4.x Router","publish_time":1377143854881,"_cnpm_publish_time":1377143854881},"0.0.1-beta-1":{"name":"express-map","version":"0.0.1-beta-1","description":"Exposes server route configuration with the client side via JavaScript","author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com"},"homepage":"https://github.com/yahoo/express-map","contributors":[{"name":"alberto chan","email":"imalberto@gmail.com"},{"name":"Caridy Patino","email":"caridy@gmail.com"}],"main":"index.js","scripts":{"test":"node ./node_modules/istanbul/lib/cli.js cover -- ./node_modules/mocha/bin/_mocha tests/unit/*.js --reporter spec","unit":"node ./node_modules/.bin/mocha tests/unit/*.js --reporter spec","lint":"node ./node_modules/.bin/jshint --config ./node_modules/yui-lint/jshint.json ./*.js ./tests/unit/*.js"},"repository":"","keywords":["config","data","expose","express","routes"],"dependencies":{"express-annotations":"*","express-state":"1.x"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"1.5.x","express":"3.x","express-params":"0.0.x","express3-handlebars":"0.5.x","istanbul":"*","jshint":"*","yui-lint":"*","mocha":"1.8.x","xunit-file":"*"},"bugs":{"url":"https://github.com/yahoo/expose-routes/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"license":"BSD","_id":"express-map@0.0.1-beta-1","dist":{"shasum":"c60cb32b4eaa0f01af50cbb24d9131169b6eb72c","tarball":"http://registry-npm.ywwl.com/express-map/download/express-map-0.0.1-beta-1.tgz","integrity":"sha512-dChqaQdxIIA+lJ3s5AjxKGwshv1C/mnzQ+0Ny4CI7Wrg/rq1pHr9Rrg7RHONWu8Fj35Eab+Nx1JhfSXoKtsayg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG98pN5qF/76r7fWFAABoubqH7p3ELLiMYGDXVyQyemrAiEAhWhEKi1NGvLdi1UyZ/7YeKGcocTbmFtc8qA0HGgEmKg="}],"size":2967,"noattachment":false,"key":"/express-map/-/express-map-0.0.1-beta-1.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"}],"directories":{},"deprecated":"No compatible with ExpressJS 4.x Router","publish_time":1376858712440,"_cnpm_publish_time":1376858712440}},"readme":"Express Map\n===========\n\n[![Build Status](https://travis-ci.org/yahoo/express-map.png?branch=master)](https://travis-ci.org/yahoo/express-map)\n[![Dependency Status](https://gemnasium.com/yahoo/express-map.png)](https://gemnasium.com/yahoo/express-map)\n[![npm Version](https://badge.fury.io/js/express-map.png)](https://npmjs.org/package/express-map)\n\nNamed routes and path lookups for Express that can be used on the server, in \nthe browser, and inside your templates. Never hard-code any URL paths in your \ncode ever again, or even share your routes between the browser and server!\n\nOverview\n--------\n\n### Goals\n\nWhile building a website, it's common to reference URL paths in multiple places,\nwhether it be inside a template, inside some redirection code, or even inside\na client-side router.\n\nIf you ever have to change a URL though, it can be difficult to go through\nall of your code, and manually change all of the URLs that you hard-coded into\nyour templates, server-side code, and client-side code.\n\nExpress Map solves this problem, and has even more advanced use cases, if you're\nconsidering building an single-page application that shares client-side routes \n(using a client-side JavaScript framework like Backbone, the YUI App Framework, \nor any other library that provides a client-side router) and server-side routes \ntogether for progressive enhancement.\n\n### How It Works\n\nExpress Map takes advantage of the route annotation system provided by\n[Express Annotations](https://github.com/yahoo/express-annotations) to add\nadditional metadata to your routes.\n\nInstallation\n------------\n\nInstall using npm:\n```\n$ npm install express-map\n```\n\nUsage\n-----\n\n### Extending an Express App\n\nTo use Express Map with an Express app, the app must first be extended. Use the\n`extend()` method that Express Map exports:\n\n```js\nvar express = require('express'),\n    expmap  = require('express-map'),\n\n    app = express();\n\nexpmap.extend(app);\n```\n\n**Note:** It's prefectly fine for the same Express app to be extended more than\nonce; after the first time the app is extended, the subsequent `extend()` calls\nwill be noops.\n\nOnce extended, the `app` object will contain three new methods as described\nbelow.\n\n## Methods\n\n### `app.map(path, name)`\n\nThis function links together a particular URL path with a name that you provide,\nthat you'll use to reference that route everywhere else, so you don't need to\nhard-code the URL path everywhere. An example:\n\n```js\n// Map our paths using Express Map\napp.map('/blog/', 'blog');\napp.map('/blog/:post', 'blog-post');\n\n// Annotate our paths using Express Annotations\napp.annotate('/blog/', {section: 'blog'});\napp.annotate('/blog/:post', {section: 'blog'});\n\n\n// Set up our actual routes\napp.get('/blog/', function (req, res) {\n    // Render the template for '/blog/' here\n});\n\napp.get('/blog/:post', function (req, res) {\n    // Render the template for '/blog/:post' here\n});\n```\n\nA common technique to use is to create a sugar method that combines the actual\n`app.VERB()` route with `app.map()`, though we kept this separate for more\nflexibility in how you use Express Map. The above is functionally equivalent to:\n\n```js\nfunction routePage(path, name, annotations, callback) {\n    app.map(path, name);\n    app.annotate(path, annotations);\n    app.get(path, callback);\n}\n\nroutePage('/blog/', 'blog', {section: 'blog'}, function (req, res) {\n    // ...\n});\n\nroutePage('/blog/:post', 'blog-post', {section: 'blog'}, function (req, res) {\n    // ...\n});\n```\n\nThis sets up the mapped route for you, which you'll use in the next functions.\n\n**Note:** You can map the same route more than once with different names, or \nprovide an array as the `name` in `app.map`. This creates **aliases**, where\nyou can reference the path by any of the names later on, and it'll return\nthe same URL path. However, as we'll see later, each route only has one\ncanonical `name`, that you can access as part of the route object.\n\n### `app.getRouteMap([annotations])`\n\nThis function returns the route map object, which contains the route metadata\nserialized into an object that can be used anywhere. If we took the above \nroutes, the serialized object would look like this:\n\n```js\n{\n    'blog': {\n        path   : '/blog/',\n        keys   : [],\n        regexp : /^\\/blog\\/\\/?$/i,\n        annotations : {\n            name    : 'blog',\n            aliases : ['blog'],\n            section : 'blog'\n        }\n    },\n\n    'blog-post': {\n        path   : '/blog/:post',\n        keys   : [{ name: 'post', optional: false }],\n        regexp : /^\\/blog\\/(?:([^\\/]+?))\\/?$/i,\n        annotations : {\n            name    : 'blog-post',\n            aliases : ['blog-post'],\n            section : 'blog'\n        }\n    }\n}\n```\n\nIf no `annotations` are passed in to `getRouteMap`, then all routes are\nreturned. Otherwise, the returned route map will be filtered by the annotations\npassed in. For instance:\n\n```js\nvar routeMap = app.getRouteMap({name: 'blog-post'});\n\n// routeMap => Will contain only the `blog-post` route\n```\n\nTake a look at the test examples to see what other filters can be applied.\n\n### `app.getRouteParams([routeMap])`\n\nThis function returns a mapping of route parameter names to the functions used\nin those route parameters created through the `app.param()` API. \n\nIt takes in an optional parameter, `routeMap`, which is the route map object\nreturned from `app.getRouteMap()`. If provided, then `getRouteParams()` will\nonly search through the routes available in the provided route map object.\n\nOtherwise, it will search through all routes available in the application.\n\nIt can be used in the following way:\n\n```js\napp.param('user', function (req, res, next, id) {\n    User.find(id, function (err, user) {\n        // ...\n    });\n});\n\napp.param('post', function (req, res, next, id) {\n    Post.find(id, function (err, post) {\n        // ...\n    });\n});\n\nvar paramMap = app.getRouteParams();\n\n/*\n    paramMap => {\n        'user': function (req, res, next, id) {\n            User.find...\n        },\n        'post': function (req, res, next, id) {\n            Post.find...\n        }\n    }\n*/\n```\n\n## Static Methods\n\n### `expmap.pathTo(routeMap)`\n\nThis static function on the Express Map instance (commonly `expmap`) takes in\na route map object, and returns a function with the following signature:\n\n```js\nfunction (routeName, [context])\n```\n\nThis returned function is meant to take in a route name, and an optional context,\nand return the contextualized URL path of that route.\n\nFor example, using our routes from before:\n\n```js\nvar routeMap = app.getRouteMap(),\n    pathTo   = expmap.pathTo(routeMap);\n\npathTo('blog-post', {post: 'hello-world'});\n// => '/blog/hello-world'\n```\n\nYou can take this function, and use it anywhere. A common use case is to turn\nit into a helper function in a template, which you can see in [one of our\nexamples](https://github.com/yahoo/express-map/tree/master/examples/path-to-routes-in-templates).\n\nAdvanced Use Cases\n------------------\n\nBeyond the simple use case of being able to reference a route by name, and\nnot having to hard code the URL into your application, there are more advanced\nuses of Express Map.\n\nCreating a single-page application today, using a framework like Backbone or\nthe YUI App Framework, often comes with a few limitations. Rendering HTML on\nthe server is much faster than sending JSON to the client, and rendering it\nthere, which is commonly done in today's single page apps. \n\nThere can be a noticeable performance problem when rendering data on slower \ndevices, such as tablets and smartphones, as well as a loss in SEO, since search\nengines will have a tougher time crawling your site. What we want to do is \nserver-side rendering on the first page load, and then client-side rendering \nafterwards for the smooth UI with no page refreshes.\n\nWhat Express Map can help you solve is to share routes between the browser and\nthe server, so you don't need to write these routes twice, since they're the\nsame.\n\nWe've provided examples for both Backbone and the YUI App Framework, so you\ncan see how a simple application that does this might work:\n\n* [Backbone Shared Routes Example][]\n* [YUI App Framework Shared Routes Example][]\n\nLicense\n-------\n\nThis software is free to use under the Yahoo! Inc. BSD license.\nSee the [LICENSE file][] for license text and copyright information.\n\n[LICENSE file]: https://github.com/yahoo/express-map/blob/master/LICENSE.md\n\nContribute\n----------\n\nSee the [CONTRIBUTING file][] for information on contributing back to Express\nMap.\n\n[CONTRIBUTING file]: https://github.com/yahoo/express-map/blob/master/CONTRIBUTING.md\n","_attachments":{},"homepage":"https://github.com/yahoo/express-map","bugs":{"url":"https://github.com/yahoo/express-map/issues"},"license":"BSD"}