node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

route-params

route-params

Get parameters from a route with segments

Install

npm install route-params --save

Usage

let routeParams = require('route-params')
 
let params = routeParams('/test/:id', '/test/123')
 
console.log(params) // {id: '123'} 

Run Tests

npm test