strip-indent
Advanced tools
Strip leading whitespace from each line in a string
Weekly downloads
Changelog
https://github.com/sindresorhus/strip-indent/compare/v3.0.0...v4.0.0
Readme
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.
$ npm install strip-indent
import stripIndent from 'strip-indent';
const string = '\tunicorn\n\t\tcake';
/*
unicorn
cake
*/
stripIndent(string);
/*
unicorn
cake
*/
Strip leading whitespace from each line in a string
The npm package strip-indent receives a total of 19,687,358 weekly downloads. As such, strip-indent popularity was classified as popular.
We found that strip-indent demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.