arnaucube
arnaucube/socketioMEANseedPublic Self-hosted repository
socketioMEANseed/server/node_modules/path-to-regexp/Readme.md
server/node_modules/path-to-regexp/Readme.mdRaw
 1
 2# Path-to-RegExp
 3
 4  Turn an Express-style path string such as `/user/:name` into a regular expression.
 5
 6## Usage
 7
 8```javascript
 9var pathToRegexp = require('path-to-regexp');
10```
11### pathToRegexp(path, keys, options)
12
13 - **path** A string in the express format, an array of such strings, or a regular expression
14 - **keys** An array to be populated with the keys present in the url.  Once the function completes, this will be an array of strings.
15 - **options**
16   - **options.sensitive** Defaults to false, set this to true to make routes case sensitive
17   - **options.strict** Defaults to false, set this to true to make the trailing slash matter.
18   - **options.end** Defaults to true, set this to false to only match the prefix of the URL.
19
20```javascript
21var keys = [];
22var exp = pathToRegexp('/foo/:bar', keys);
23//keys = ['bar']
24//exp = /^\/foo\/(?:([^\/]+?))\/?$/i
25```
26
27## Live Demo
28
29You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/).
30
31## License
32
33  MIT