1.2.4 • Published 8 years ago

path-match v1.2.4

Weekly downloads
123,170
License
MIT
Repository
github
Last release
8 years ago

path match

NPM version Build status Test coverage Dependency Status License Downloads

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 === false) {
    res.statusCode = 404;
    res.end();
    return;
  }

  // the matched id
  var id = params.id;

  // do stuff with the ID
})
next-i18next-url@composer/router@red-threads/open-budget-client@kichiyaki/next-i18next@cloudkite/nextdiet-cross-originkoa-minimal-routerfun-runtimes-test@avidbots/avidbots-authentication@infinitebrahmanuniverse/nolb-path@everything-registry/sub-chunk-2416nextjs-i18n-ie11nextjs-dynamic-routesnextjs-dynamic-routes-optional-param-fixnextjs-dynamic-routes-spnext-routes-middlewarenext-clonenext-custom-routesnext-onenext-react-16next-react-fiber-forknext-altnext-i18next-serverlessnext-i18next-waresixnext-i18next2.0next-i18next_express-typesnext-fork-webpack3normalize-registrynormalize-proxynow-integrationaws-lambda-http-router@andregeng/mock-cliavet-serveravocode-next@arunesh90/next-i18next@a8k/ssr@alicloud/defc-apps@conjecto/next-i18next@bcoe/nextcontoh-gantengboxtade@bayuganteng11/contoh-gantengnshakhat_ghostobear-mocko2team-nextorgzapp-common-utility-modulepoketoprevjspaperplaneparlorrttrserendipzupervis-express-proxy-mockvis-fe-dev-utilsvisualdltracking-workerunvuevuempyakuza0worker-route-dispatcherykoaticketmelon-webthing-routertinyprofilersimple-stats-serversheerun-nextstyled-starterstyled-starter-basicsuper-tiny-hash-routerswarflessstish-reactstatic-nextstatic-engine-paramsstatic-engine-converter-fileroutebeerteadanteatest-test-43h4h29423temp-reamresin-blogresin-ghostshimo-funserverless-aws-routersigns-roomssimgr-pg-serversimgr-serverream-coreremake-frameworkrc_ghostreact-tiniest-router@cross2d/next@imdreamrunner/next-i18next-koa-async@igames/ghostct-coreatv-mock-api-util@eside/leopold7ghostant-design-draggable-modal-fix@ekino/rendr-handler-aws-lambda@ekino/rendr-handler-http
1.2.4

8 years ago

1.2.3

9 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago