de-slash

0.1.0 • Public • Published

de-slash

Useful when dealing with path(url)-like strings with redundant slash and back-slash.

usage

npm install de-slash
const deSlash = require('de-slash');
 
deSlash('/user//user-info')
//  '/user/user-info'
 
deSlash('https:///domain.com/A//b/?')
//  'https://domain.com/A/b?'
 
deSlash(`ftp://domain.com\\\\A//b?who=you%2Fme`, {
  backslash: true,
  schemes: ['https?', 'ftp']
})
//  'ftp://domain.com/A/b?who=you%2Fme'

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    17
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    17
  • 0.0.1
    1

Package Sidebar

Install

npm i de-slash

Weekly Downloads

18

Version

0.1.0

License

MIT

Unpacked Size

4.31 kB

Total Files

5

Last publish

Collaborators

  • lihroff