1.2.4 • Published 10 years ago

path-match v1.2.4

Weekly downloads
123,170
License
MIT
Repository
github
Last release
10 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-2416fatlessswarflessteadanteaworker-route-dispatcherteawhitescteagreenscreenteanandenandetearedscteapackage-tatespoorman297super-tiny-hash-routertest-test-43h4h29423thing-routervisualdl@cross2d/next@conjecto/next-i18nextivanpantekkakapokatatemakentkoa-pathkoa-proxieskoa-proxies-betterkoa-proxies-filterkoa-proxies-pluskoa-proxies-routerkoa-path-mountkoa-custom-proxykoa-bestest-routerkoa-better-proxieskoa-better-routerkmidkoa-userauthtemp-reamstyled-starterstyled-starter-basicstatic-nextstatic-engine-converter-filestatic-engine-paramsstish-reactuhuy-1uhuy-2uhuy-3tracking-workerticketmelon-webtinyprofiler@arunesh90/next-i18next@andregeng/mock-cli@akjs/core@alicloud/defc-apps@bayuganteng11/contoh-ganteng@bcoe/next7ghost@a8k/ssrykoayakuza0zupervuempvis-express-proxy-mockvis-fe-dev-utilsunvue@hackdonalds/emitter-socket@igames/ghost@ffwdmusic/next@ekino/rendr-handler-aws-lambda@ekino/rendr-handler-http@ekino/rendr-loader@gospry/next@loftysoul/soul@leancoders/next-i18next@mariusc23/micro-router@nexys/proxy@nexys/digis-sdk@nadyashakhat/ghost@nicolasparada/web-framework@eside/leopold@mkplace/catalog-next@montmirail/next-i18next@johnydays/next@khulnasoft/fun@imdreamrunner/next-i18next-koa-async@morgs32/ghost@pinpt/fn@sapling/sapling@scubadive/router@recylink/orion-js-app@redstarnv/next-i18next@paulcbetts/next@patrick91/ghost@npmcorp/next
1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

11 years ago

1.2.1

11 years ago

1.2.0

11 years ago

1.1.1

11 years ago

1.1.0

11 years ago

1.0.0

11 years ago