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

github actions coverage dependency status dev dependency status 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.9)

Integrity sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==
SHASUM 62e2731272cd285041b36596054e9f66569b6942
Tarball https://js.registry.sudovanilla.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz