strip-indent (3.0.0)
Published 2026-02-24 14:05:46 +00:00 by atheaadmin
Installation
registry=npm install strip-indent@3.0.0"strip-indent": "3.0.0"About this package
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
const stripIndent = require('strip-indent');
const string = '\tunicorn\n\t\tcake';
/*
unicorn
cake
*/
stripIndent(string);
/*
unicorn
cake
*/
Related
- strip-indent-cli - CLI for this module
- indent-string - Indent each line in a string
License
MIT © Sindre Sorhus
Dependencies
Dependencies
| ID | Version |
|---|---|
| min-indent | ^1.0.0 |
Development Dependencies
| ID | Version |
|---|---|
| ava | ^1.4.1 |
| tsd | ^0.7.2 |
| xo | ^0.24.0 |
Keywords
strip
indent
indentation
normalize
remove
delete
whitespace
space
tab
string
Details
Assets (1)
Versions (2)
View all
strip-indent-3.0.0.tgz
1.7 KiB