# ltrim

> Strip whitespace - or other characters - from the beginning of a string

Latest version **1.0.1** (published 2020-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install ltrim
pnpm add ltrim
yarn add ltrim
bun add ltrim
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-11-25 |
| First published | 2016-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sergej Müller |
| Maintainers | sergej.mueller |
| Keywords | trim, ltrim, strip, string |

## Links

- npm: https://www.npmjs.com/package/ltrim
- Repository: https://github.com/sergejmueller/ltrim
- Issues: https://github.com/sergejmueller/ltrim/issues
- npm.io page: https://npm.io/package/ltrim

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-11-25
- 1.0.0 — 2016-10-27
- 0.0.3 — 2016-06-17
- 0.0.2 — 2016-06-17
- 0.0.1 — 2016-06-17

## README

ltrim
============

`ltrim` Node.js module returns a string with whitespace (or other characters) stripped from the beginning of a string. Without dependencies and library bloat.


[![Build Status](https://travis-ci.org/sergejmueller/ltrim.svg?branch=master)](https://travis-ci.org/sergejmueller/ltrim)
[![Code Climate](https://codeclimate.com/github/sergejmueller/ltrim/badges/gpa.svg)](https://codeclimate.com/github/sergejmueller/ltrim)
[![Known Vulnerabilities](https://snyk.io/test/github/sergejmueller/ltrim/badge.svg)](https://snyk.io/test/github/sergejmueller/ltrim)


Install
-----

```bash
npm install ltrim
```

*or*

```bash
yarn add ltrim
```


Usage
-----

```javascript
ltrim (str[, chars])
```

Parameter | Description
--- | ---
`str` | The input string
`chars` | Characters that you want to be stripped

Without the second parameter, `ltrim` will strip whitespaces (spaces, tabs and new lines).


Examples
-----

```javascript
var ltrim = require('ltrim');

/* Strip whitespace from the beginning of a string */
ltrim('    Hello    ') + ' World' // →Hello     World

/* Strip multiple special chars from the beginning of a string */
ltrim('... Hello World ...', ' .'); // →Hello World ...

/* Strip multiple chars from the beginning of a string */
ltrim('Hello World', 'Hdle'); // →o World

/* Strip url protocol from the beginning of a string */
ltrim('https://goo.gl/', '/:htps'); // →goo.gl/
```

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