slash-to-regexp
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

slash-to-regexp

Convert path with slash into regexp.

npm license node

Installation

npm install slash-to-regexp

Usage

const slashToRegexp = require('slash-to-regexp');
 
slashToRegexp('node_modules/core-js');
// output /node_modules[\\/]core-js/
 
slashToRegexp('node_modules\\\\core-js', 'g');
// output /node_modules[\\/]core-js/g
 
slashToRegexp('/node_modules/decimal.js/');
// output /[\\/]node_modules[\\/]decimal\.js[\\/]/

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    35
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    35
  • 0.0.3
    1
  • 0.0.2
    0
  • 0.0.1
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i slash-to-regexp

Weekly Downloads

36

Version

0.0.4

License

MIT

Unpacked Size

2.33 kB

Total Files

4

Last publish

Collaborators

  • airkro