# string.prototype.trimstart

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

Latest version **1.0.8** (published 2024-03-21) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2024-03-21 |
| First published | 2017-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 3 |
| Unpacked size | 22.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jordan Harband |
| Maintainers | khaledelansari, ljharb |
| Keywords | es6, es7, es8, javascript, prototype, polyfill, utility, trim, trimLeft, trimRight, trimStart, trimEnd, tc39 |

## Links

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

## Dependencies (3)

- [call-bind](https://npm.io/package/call-bind.md) ^1.0.7
- [es-object-atoms](https://npm.io/package/es-object-atoms.md) ^1.0.0
- [define-properties](https://npm.io/package/define-properties.md) ^1.2.1

## 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

- 1.0.8 (latest) — 2024-03-21
- 1.0.7 — 2023-09-05
- 1.0.6 — 2022-11-07
- 1.0.5 — 2022-05-03
- 1.0.4 — 2021-02-24
- 1.0.3 — 2020-11-22
- 1.0.2 — 2020-10-20
- 1.0.1 — 2020-04-09
- 1.0.0 — 2020-03-30
- 0.1.0 — 2017-12-19
- 0.0.1 — 2017-12-19

## README

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

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-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]

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](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://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 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`

[package-url]: https://npmjs.com/package/string.prototype.trimstart
[npm-version-svg]: https://vb.teelaun.ch/es-shims/String.prototype.trimStart.svg
[deps-svg]: https://david-dm.org/es-shims/String.prototype.trimStart.svg
[deps-url]: https://david-dm.org/es-shims/String.prototype.trimStart
[dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trimStart/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trimStart#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/string.prototype.trimstart.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/string.prototype.trimstart.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/string.prototype.trimstart.svg
[downloads-url]: https://npm-stat.com/charts.html?package=string.prototype.trimstart
[codecov-image]: https://codecov.io/gh/es-shims/String.prototype.trimStart/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/String.prototype.trimStart/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/String.prototype.trimStart
[actions-url]: https://github.com/es-shims/String.prototype.trimStart/actions

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