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[\\/]/

Dependencies (0)

    Dev Dependencies (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