String.prototype.trimEnd <sup>Version Badge</sup>

github actions coverage License Downloads

npm badge

An ES2019-spec-compliant String.prototype.trimEnd shim. Invoke its "shim" method to shim String.prototype.trimEnd if it is unavailable.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec. In an ES6 environment, it will also work properly with Symbols.

Most common usage:

var trimEnd = require('string.prototype.trimend');

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

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

assert(trimEnd(' \t\na \t\n ') === ' \t\na \t\n '.trimEnd());

Tests

Simply clone the repo, npm install, and run npm test

string.prototype.trimend - Installation

To install string.prototype.trimend via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install string.prototype.trimend --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install string.prototype.trimend

Learn more about the config option.

PNPM

pnpm install string.prototype.trimend --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install string.prototype.trimend --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

string.prototype.trimend - Download

Download Tarball (v1.0.10)

Integrity sha512-2+3aDAOmPTmuFwjDnmJG2ctEkQKVki7vOSqaxkv42Mowj1V6PnvuwFCRrR5lChUux1TBskPjfkeTOhqczDMxTw==
SHASUM be6bcf4f3fe0460bdeccdb2cf4f971b310f8346e
Tarball https://js.registry.sudovanilla.org/string.prototype.trimend/-/string.prototype.trimend-1.0.10.tgz