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

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2019-spec-compliant String.prototype.trimStart shim. Invoke its "shim" method to shim String.prototype.trimStart 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 trimStart = require('string.prototype.trimstart');

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

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

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

Tests

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

string.prototype.trimstart - Installation

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

n

NPM

npm install string.prototype.trimstart --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.trimstart

Learn more about the config option.

PNPM

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

Learn more about the --registry parameter.

Bun Logo

Bun

bun install string.prototype.trimstart --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.trimstart - Download

Download Tarball (v1.0.8)

Integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==
SHASUM 7ee834dda8c7c17eff3118472bb35bfedaa34dde
Tarball https://js.registry.sudovanilla.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz