https://github.com/fabioricali/super-trailing-slash
Add or remove trailing slash
https://github.com/fabioricali/super-trailing-slash
backslash javascript path trailing-slash url
Last synced: about 1 year ago
JSON representation
Add or remove trailing slash
- Host: GitHub
- URL: https://github.com/fabioricali/super-trailing-slash
- Owner: fabioricali
- License: mit
- Created: 2017-08-27T10:42:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-13T15:55:48.000Z (over 8 years ago)
- Last Synced: 2025-03-18T14:35:43.988Z (about 1 year ago)
- Topics: backslash, javascript, path, trailing-slash, url
- Language: JavaScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Installation
### Node.js
```
npm install super-trailing-slash --save
```
## Example
#### Add trailing slash
```javascript
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
```javascript
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