# trim-right

> Similar to `String#trim()` but removes only whitespace on the right

Latest version **2.0.0** (published 2021-04-21) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install trim-right
pnpm add trim-right
yarn add trim-right
bun add trim-right
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-04-21 |
| First published | 2015-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | trim, right, string, whitespace, space, remove, delete, end, trailing |

## Links

- npm: https://www.npmjs.com/package/trim-right
- Repository: https://github.com/sindresorhus/trim-right
- Homepage: https://github.com/sindresorhus/trim-right#readme
- Issues: https://github.com/sindresorhus/trim-right/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/trim-right

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-04-21
- 1.0.1 — 2015-07-15
- 1.0.0 — 2015-02-17

## README

# trim-right

> Similar to [`String#trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) but removes only whitespace on the right

## Install

```
$ npm install trim-right
```

## Usage

```js
import trimRight from 'trim-right';

trimRight('  unicorn  ');
//=> '  unicorn'
```

## Related

- [`trim-left`](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left
- [`trim-off-newlines`](https://github.com/stevemao/trim-off-newlines) - Similar to `String#trim()` but removes only newlines

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-trim-right?utm_source=npm-trim-right&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

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