# string.prototype.trimright

> ES2019 spec-compliant String.prototype.trimLeft shim.

Latest version **2.1.3** (published 2020-11-22) · MIT license · 0 weekly downloads

> **Native alternative:** String.prototype.trimRight — Use native JavaScript (Node 10.0.0+) (https://developer.mozilla.orgGlobal_Objects/String/trimRight)

## Install

```sh
npm install string.prototype.trimright
pnpm add string.prototype.trimright
yarn add string.prototype.trimright
bun add string.prototype.trimright
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2020-11-22 |
| First published | 2015-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 3 |
| Unpacked size | 17.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | String.prototype.trimRight, string, ES7, ES2019, shim, trim, trimLeft, trimStart, trimRight, trimEnd, polyfill, es-shim API |

## Links

- npm: https://www.npmjs.com/package/string.prototype.trimright
- Repository: https://github.com/es-shims/String.prototype.trimRight
- Homepage: https://github.com/es-shims/String.prototype.trimRight#readme
- Issues: https://github.com/es-shims/String.prototype.trimRight/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/string.prototype.trimright

## Dependencies (3)

- [call-bind](https://npm.io/package/call-bind.md) ^1.0.0
- [define-properties](https://npm.io/package/define-properties.md) ^1.1.3
- [string.prototype.trimend](https://npm.io/package/string.prototype.trimend.md) ^1.0.3

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 2.1.3 (latest) — 2020-11-22
- 2.1.2 — 2020-03-30
- 2.1.1 — 2019-12-18
- 2.1.0 — 2019-09-10
- 2.0.0 — 2016-02-07
- 1.0.1 — 2015-07-29

## README

String.prototype.trimRight <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

[![browser support][testling-svg]][testling-url]

A ES2019-spec-compliant `String.prototype.trimRight` shim. Invoke its "shim" method to shim `String.prototype.trimRight` if it is unavailable.

This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s.

Most common usage:
```js
var trimRight = require('string.prototype.trimright');

assert(trimRight(' \t\na \t\n') === 'a \t\n');

if (!String.prototype.trimRight) {
	trimRight.shim();
}

assert(trimRight(' \t\na \t\n ') === ' \t\na \t\n '.trimRight());
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[package-url]: https://npmjs.com/package/string.prototype.trimright
[npm-version-svg]: http://vb.teelaun.ch/es-shims/String.prototype.trimRight.svg
[travis-svg]: https://travis-ci.org/es-shims/String.prototype.trimRight.svg
[travis-url]: https://travis-ci.org/es-shims/String.prototype.trimRight
[deps-svg]: https://david-dm.org/es-shims/String.prototype.trimRight.svg
[deps-url]: https://david-dm.org/es-shims/String.prototype.trimRight
[dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trimRight/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trimRight#info=devDependencies
[testling-svg]: https://ci.testling.com/es-shims/String.prototype.trimRight.png
[testling-url]: https://ci.testling.com/es-shims/String.prototype.trimRight
[npm-badge-png]: https://nodei.co/npm/string.prototype.trimright.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/string.prototype.trimright.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/string.prototype.trimright.svg
[downloads-url]: http://npm-stat.com/charts.html?package=string.prototype.trimright

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