# remove-trailing-separator

> Removes separators from the end of the string.

Latest version **1.1.0** (published 2017-08-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install remove-trailing-separator
pnpm add remove-trailing-separator
yarn add remove-trailing-separator
bun add remove-trailing-separator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-08-16 |
| First published | 2016-09-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | darsain |
| Maintainers | darsain |
| Keywords | remove, strip, trailing, separator |

## Links

- npm: https://www.npmjs.com/package/remove-trailing-separator
- Repository: https://github.com/darsain/remove-trailing-separator
- Homepage: https://github.com/darsain/remove-trailing-separator#readme
- Issues: https://github.com/darsain/remove-trailing-separator/issues
- npm.io page: https://npm.io/package/remove-trailing-separator

## Recent versions

- 1.1.0 (latest) — 2017-08-16
- 1.0.2 — 2017-06-07
- 1.0.1 — 2016-09-25
- 1.0.0 — 2016-09-24

## README

# remove-trailing-separator

[![NPM version][npm-img]][npm-url] [![Build Status: Linux][travis-img]][travis-url] [![Build Status: Windows][appveyor-img]][appveyor-url] [![Coverage Status][coveralls-img]][coveralls-url]

Removes all separators from the end of a string.

## Install

```
npm install remove-trailing-separator
```

## Examples

```js
const removeTrailingSeparator = require('remove-trailing-separator');

removeTrailingSeparator('/foo/bar/')   // '/foo/bar'
removeTrailingSeparator('/foo/bar///') // '/foo/bar'

// leaves only/last separator
removeTrailingSeparator('/')    // '/'
removeTrailingSeparator('///')  // '/'

// returns empty string
removeTrailingSeparator('') // ''
```

## Notable backslash, or win32 separator behavior

`\` is considered a separator only on WIN32 systems. All POSIX compliant systems
see backslash as a valid file name character, so it would break POSIX compliance
to remove it there.

In practice, this means that this code will return different things depending on
what system it runs on:

```js
removeTrailingSeparator('\\foo\\')
// UNIX  => '\\foo\\'
// WIN32 => '\\foo'
```

[npm-url]: https://npmjs.org/package/remove-trailing-separator
[npm-img]: https://badge.fury.io/js/remove-trailing-separator.svg
[travis-url]: https://travis-ci.org/darsain/remove-trailing-separator
[travis-img]: https://travis-ci.org/darsain/remove-trailing-separator.svg?branch=master
[appveyor-url]: https://ci.appveyor.com/project/darsain/remove-trailing-separator/branch/master
[appveyor-img]: https://ci.appveyor.com/api/projects/status/wvg9a93rrq95n2xl/branch/master?svg=true
[coveralls-url]: https://coveralls.io/github/darsain/remove-trailing-separator?branch=master
[coveralls-img]: https://coveralls.io/repos/github/darsain/remove-trailing-separator/badge.svg?branch=master

---
_Source: https://npm.io/package/remove-trailing-separator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
