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

44 lines
843 B
Text

# strip-indent [![Build Status](https://travis-ci.org/sindresorhus/strip-indent.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-indent)
> Strip leading whitespace from each line in a string
The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.
Useful for removing redundant indentation.
## Install
```
$ npm install strip-indent
```
## Usage
```js
const stripIndent = require('strip-indent');
const string = '\tunicorn\n\t\tcake';
/*
unicorn
cake
*/
stripIndent(string);
/*
unicorn
cake
*/
```
## Related
- [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 © [Sindre Sorhus](https://sindresorhus.com)