Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

remove-trailing-separator

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Issues
File Explorer

Advanced tools

remove-trailing-separator

Removes separators from the end of the string.

    1.1.0latest

Version published
Maintainers
1
Weekly downloads
15,365,705
decreased by-10.64%

Weekly downloads

Readme

Source

remove-trailing-separator

NPM version Build Status: Linux Build Status: Windows Coverage Status

Removes all separators from the end of a string.

Install

npm install remove-trailing-separator

Examples

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:

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

Keywords

FAQs

What is remove-trailing-separator?

Removes separators from the end of the string.

Is remove-trailing-separator popular?

The npm package remove-trailing-separator receives a total of 14,636,356 weekly downloads. As such, remove-trailing-separator popularity was classified as popular.

Is remove-trailing-separator well maintained?

We found that remove-trailing-separator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 16 Aug 2017

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc