npm install string.prototype.trimend

ES2019 spec-compliant String.prototype.trimEnd shim.

About string.prototype.trimend

The npm package / node module "string.prototype.trimend" is a vital tool for JavaScript developers. Its chief purpose is to provide an ES2019 spec-compliant shim for the String.prototype.trimEnd function. This function is beneficial as it removes any trailing white space from the end of a string, providing cleaner, more precise data. Its compliance with the ES2019 spec also ensures it's up-to-date and compatible with the latest JavaScript standards.

By simply typing "npm install string.prototype.trimend" into the command line, developers can easily add this valuable tool to their project. This command allows for swift installation and implementation of the package in any JavaScript environment. Once installed, it gives developers access to a reliable method for trimming the end of strings, enhancing the accuracy and efficiency of their code processing. Using "npm install string.prototype.trimend" is the first step to achieving cleaner and more manageable data in your project.

The "string.prototype.trimend" package is not just about trimming spaces off the end of a string, it's about enhancing the overall quality of data handling in JavaScript projects. By eliminating unnecessary spaces, it ensures a higher level of data accuracy and consistency. This npm package is a testament to the importance of precision and cleanliness in coding, making it a must-have tool for JavaScript developers seeking to optimize their data processing and manipulation tasks.

More from es-shims

es-shims npm packages

Find the best node modules for your project.

Search npm

regexp.prototype.flags

ES6 spec-compliant RegExp.prototype.flags shim...

Read more
,

string.prototype.trimend

ES2019 spec-compliant String.prototype.trimEnd shim...

Read more
,

string.prototype.trimstart

ES2019 spec-compliant String.prototype.trimStart shim...

Read more
,

arraybuffer.prototype.slice

ES spec-compliant shim for ArrayBuffer.prototype...

Read more
,

string.prototype.matchall

Spec-compliant polyfill for String.prototype...

Read more
,

object.groupby

An ESnext spec-compliant `Object.groupBy` shim/polyfill/replacement that works as far down as ES3...

Read more
,

array.prototype.tosorted

An ESnext spec-compliant `Array.prototype...

Read more
,

es-iterator-helpers

An ESnext spec-compliant iterator helpers shim/polyfill/replacement that works as far down as ES3...

Read more
,

array.prototype.toreversed

An ESnext spec-compliant `Array.prototype...

Read more
,

typedarray.prototype.slice

ES spec-compliant shim for TypedArray.prototype...

Read more
,

string.prototype.replaceall

Spec-compliant polyfill for String.prototype...

Read more
,

error-cause

An ES-spec-compliant shim/polyfill/replacement for the `...

Read more

Dependencies

Core dependencies of this npm package and its dev dependencies.

call-bind, define-properties, es-object-atoms, @es-shims/api, @ljharb/eslint-config, aud, auto-changelog, eslint, functions-have-names, has-strict-mode, in-publish, npmignore, nyc, safe-publish-latest, tape

Documentation

A README file for the string.prototype.trimend code repository. View Code

String.prototype.trimEnd Version Badge

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