Urara-Blog/node_modules/.pnpm-store/v3/files/ce/e5151cf57d43ad666832c2917671acba9763ad2fb05b97d282bf67e4d6f28ae3b77142f26f1349238df3fa9abb10cc122b5047556cce139fc3812f8e862ef7
2022-08-14 01:14:53 +08:00

41 lines
926 B
Text

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