Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

super-trailing-slash

fabioricali368MIT1.0.2

Add or remove trailing slash

add, remove, trailing, slash, url

readme

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

changelog

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[1.0.2] - 2018-03-13

  • Added "dist" version

[1.0.1] - 2017-08-27

  • First release