# lpad-align

> Left pad a string to align with the longest string in an array

Latest version **3.0.0** (published 2021-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install lpad-align
pnpm add lpad-align
yarn add lpad-align
bun add lpad-align
```

Provides the command `lpad-align`.

## 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 | 3.0.0 |
| Published | 2021-07-05 |
| First published | 2014-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 4 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Kevin Mårtensson |
| Maintainers | kevva |
| Keywords | align, indent, lpad |

## Links

- npm: https://www.npmjs.com/package/lpad-align
- Repository: https://github.com/kevva/lpad-align
- Homepage: https://github.com/kevva/lpad-align#readme
- Issues: https://github.com/kevva/lpad-align/issues
- npm.io page: https://npm.io/package/lpad-align

## Dependencies (4)

- [meow](https://npm.io/package/meow.md) ^9.0.0
- [longest](https://npm.io/package/longest.md) ^2.0.0
- [get-stdin](https://npm.io/package/get-stdin.md) ^5.0.1
- [indent-string](https://npm.io/package/indent-string.md) ^3.0.0

## Recent versions

- 3.0.0 (latest) — 2021-07-05
- 2.0.0 — 2017-05-22
- 1.1.2 — 2017-05-22
- 1.1.1 — 2017-05-21
- 1.1.0 — 2015-07-18
- 1.0.3 — 2015-02-26
- 1.0.2 — 2014-10-24
- 1.0.1 — 2014-10-23
- 1.0.0 — 2014-10-15

## README

# lpad-align [![Build Status](https://travis-ci.org/kevva/lpad-align.svg?branch=master)](https://travis-ci.org/kevva/lpad-align)

> Left pad a string to align with the longest string in an array

## Install

```
$ npm install lpad-align
```

## Usage

```js
const lpadAlign = require('lpad-align');

const words = [
	'foo',
	'foobar',
	'foobarcat'
];

for (const x of words) {
	console.log(lpadAlign(x, words, 4));
}

/*
		  foo
	   foobar
	foobarcat
 */
```

## API

### lpadAlign(string, array, indent)

#### string

Type: `string`

String that will be padded.

#### array

Type: `Array`

Array to align against.

#### indent

Type: `number`\
Default: `4`

Indentation to prepend the string with.

## CLI

```
$ npm install --global lpad-align
```

```
  Usage
    $ cat <file> | lpad-align

  Example
    $ cat unicorn.txt | lpad-align
          foo
       foobar
    foobarcat
```

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