# rtrim

> Strip whitespace - or other characters - from the end of a string

Latest version **1.0.1** (published 2020-11-25) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install rtrim
pnpm add rtrim
yarn add rtrim
bun add rtrim
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-11-25 |
| First published | 2016-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sergej Müller |
| Maintainers | sergej.mueller |
| Keywords | trim, rtrim, strip, string |

## Links

- npm: https://www.npmjs.com/package/rtrim
- Repository: https://github.com/sergejmueller/rtrim
- Issues: https://github.com/sergejmueller/rtrim/issues
- npm.io page: https://npm.io/package/rtrim

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-11-25
- 1.0.0 — 2016-10-28
- 0.0.3 — 2016-06-17
- 0.0.2 — 2016-06-17
- 0.0.1 — 2016-06-16

## README

rtrim
============

`rtrim` Node.js module returns a string with whitespace (or other characters) stripped from the end of a string. Without dependencies and library bloat.


[![Build Status](https://travis-ci.org/sergejmueller/rtrim.svg?branch=master)](https://travis-ci.org/sergejmueller/rtrim)
[![Code Climate](https://codeclimate.com/github/sergejmueller/rtrim/badges/gpa.svg)](https://codeclimate.com/github/sergejmueller/rtrim)
[![Known Vulnerabilities](https://snyk.io/test/github/sergejmueller/rtrim/badge.svg)](https://snyk.io/test/github/sergejmueller/rtrim)


Install
-----

```bash
npm install rtrim
```

*or*

```bash
yarn add rtrim
```


Usage
-----

```javascript
rtrim(str[, chars])
```

Parameter | Description
--- | ---
`str` | The input string
`chars` | Characters that you want to be stripped

Without the second parameter, `rtrim` will strip whitespaces (spaces, tabs and new lines).


Examples
-----

```javascript
var rtrim = require('rtrim');

/* Strip whitespace from the end of a string */
rtrim('    Hello    ') + ' World' // →    Hello World

/* Strip multiple special chars from the end of a string */
rtrim('... Hello World ...', ' .'); // →... Hello World

/* Strip multiple chars from the end of a string */
rtrim('Hello World', 'Hdle'); // →Hello Wor

/* Strip trailing slash from the end of a string */
rtrim('https://goo.gl/', '/'); // →https://goo.gl
```

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