Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 24 days 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-13T15:55:48.000Z (over 6 years ago)
- Last Synced: 2024-10-12T19:09:12.230Z (about 1 month ago)
- Topics: backslash, javascript, path, trailing-slash, url
- Language: JavaScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- 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