# min-indent

> Get the shortest leading whitespace from lines in a string

Latest version **1.0.1** (published 2020-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install min-indent
pnpm add min-indent
yarn add min-indent
bun add min-indent
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-05-28 |
| First published | 2017-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/min-indent) |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | James Kyle |
| Maintainers | sindresorhus, thejameskyle |
| Keywords | indent, indentation, normalize, whitespace, space, tab, string, str, min, minimum |

## Links

- npm: https://www.npmjs.com/package/min-indent
- Repository: https://github.com/thejameskyle/min-indent
- Homepage: https://github.com/thejameskyle/min-indent#readme
- Issues: https://github.com/thejameskyle/min-indent/issues
- npm.io page: https://npm.io/package/min-indent

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-05-28
- 1.0.0 — 2017-10-27

## README

# min-indent [![Build Status](https://travis-ci.org/thejameskyle/min-indent.svg?branch=master)](https://travis-ci.org/thejameskyle/min-indent)

> Get the shortest leading whitespace from lines in a string

The line with the least number of leading whitespace, ignoring empty lines, determines the number.

Useful for removing redundant indentation.


## Install

```
$ npm install --save min-indent
```


## Usage

```js
const minIndent = require('min-indent');

const str = '\tunicorn\n\t\tcake';
/*
	unicorn
		cake
*/

minIndent(str); // 1
```


## Related

- [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from each line in a string
- [strip-indent-cli](https://github.com/sindresorhus/strip-indent-cli) - CLI for this module
- [indent-string](https://github.com/sindresorhus/indent-string) - Indent each line in a string


## License

MIT © [James Kyle](https://thejameskyle.com)

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