li-urlpattern

0.0.1 • Public • Published

Build Status

Coverage Status

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.

Package Sidebar

Install

npm i li-urlpattern

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • liangyali