li-urlpattern
v0.0.1
Published
urlpattern parse
Downloads
4
Maintainers
Readme
urlpattern parse Getting Started
Install the module with: npm install li-urlpattern
var pattern = require('li-urlpattern');
// -> /users/1000
pattern.parse('/users/:id', {id: 1000});
Documentation
(Coming soon)
Examples
var pattern = require('li-urlpattern');
// => /users/1000
pattern.parse('/users/:id', {id: 1000});
// =>/users/1000?type=1
pattern.parse('/users/:id', {id: 1000,type:1});
// =>/users/1000.json?type=1
pattern.parse('/users/:id.:format', {id: 1000,format:'json',type:1});
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
License
Copyright (c) 2014 liangyali
Licensed under the MIT license.