remove-trailing-path-separator

Remove trailing path separator from string.

Usage no npm install needed!

<script type="module">
  import removeTrailingPathSeparator from 'https://cdn.skypack.dev/remove-trailing-path-separator';
</script>

README

remove-trailing-path-separator

NPM version Travis-CI Status Appveyor Status Daviddm Status

Remove trailing path separator from string.

Install

$ npm install --save remove-trailing-path-separator

Usage

var removeTrailingPathSeparator = require('remove-trailing-path-separator');

removeTrailingPathSeparator('/foo/bar/baz/');
//=> /foo/bar/baz
removeTrailingPathSeparator('/foo/bar/baz//');
//=> /foo/bar/baz
removeTrailingPathSeparator('\\foo\\bar\\baz\\');
//=> \\foo\\bar\\baz
removeTrailingPathSeparator('\\foo\\bar\\baz\\\\');
//=> \\foo\\bar\\baz

API

removeTrailingPathSeparator(input) -> String

input

Required
Type: string

Like path string.

Changelog

changelog.md.

License

MIT © sanemat