super-trailing-slash

1.0.2 • Public • Published

super-trailing-slash

Remove or add trailing slash.

Installation

Node.js

npm install super-trailing-slash --save

Example

Add trailing slash

const slash = require('super-trailing-slash');
 
slash.add('path/to/file'); //=> path/to/file/
slash.add('\\path\\to\\file'); //=> \path\to\file\
 
// Adds only if necessary
slash.add('path/to/file/'); //=> path/to/file/

Remove trailing slash

slash.remove('path/to/file/'); //=> path/to/file
slash.remove('\\path\\to\\file\\'); //=> \path\to\file
 
// Removes only if necessary
slash.remove('path/to/file'); //=> path/to/file

API

See full documentation

Changelog

You can view the changelog here

License

super-trailing-slash is open-sourced software licensed under the MIT license

Author

Fabio Ricali

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    18
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    18
  • 1.0.1
    0

Package Sidebar

Install

npm i super-trailing-slash

Weekly Downloads

18

Version

1.0.2

License

MIT

Unpacked Size

12.2 kB

Total Files

8

Last publish

Collaborators

  • fabioricali