1.0.1 • Published 7 years ago

regex-slash v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

regex-slash Build Status

Convert regex pattern strings for Windows backslash paths to Unix paths: path\\\\to\\\\file.jspath/to/file.js

Inspired by slash.

Install

$ npm install --save regex-slash

or with yarn

$ yarn add regex-slash

Usage

const rslash = require('regex-slash');

const windowsPattern = 'path\\\\to\\\\file.js';
const unixPattern = 'path/to/file.js';

rslash(windowsPattern); // => 'path/to/file.js'
rslash(unixPattern); // => 'path/to/file.js'

API

rslash(path)

Type: string

Accepts a Windows backslash path regex pattern string and returns a Unix path regex pattern string

License

MIT © Scott Ranger