Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

path-to-regexp-wrap

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-to-regexp-wrap

Wrapper for Express.js 'path-to-regexp' module

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

path-to-regexp-wrap

Build Status

It's a simple wrapper of original path-to-regexp module.

Usage

const path = require('path-to-regexp-wrap')();    // options object could be passed as well 
const route = '/get/:id';
const match = path(route);

const params = match('/get/1');
// returns {'id': '1'}
console.log(params);
    

Options

  • options.sensitive Defaults to false, set this to true to make routes case sensitive

  • options.strict Defaults to false, set this to true to make the trailing slash matter.

  • options.end Defaults to true, set this to false to only match the prefix of the URL.

  • Advanced options (use for non-pathname strings, e.g. host names):

    • delimiter The default delimiter for segments. (default: '/')
    • endsWith Optional character, or list of characters, to treat as "end" characters.
    • delimiters List of characters to consider delimiters when parsing. (default: './')

Keywords

FAQs

Package last updated on 27 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc