package
wrapper around path-to-regexp for easy route parameters
npm install path-matchGitHub-flavored package documentation.
Across all versions, last 30 days.
2,375,224 in 30 days
Runtime metadata.
Tagged topics.
Estimated unpacked size across 8 packages.
128.7 kB
Includes dependencies.
Thin wrapper around path-to-regexp to make extracting the param names easier.
var route = require('path-match')({
// path-to-regexp options
sensitive: false,
strict: false,
end: false,
});
// create a match function from a route
var match = route('/post/:id');
// match a route
var parse = require('url').parse;
require('http').createServer(function (req, res) {
var params = match(parse(req.url).pathname);
// no match
if (params ===
dougwilson
doug@somethingdoug.com