strip-indent alternatives and similar modules
Based on the "Text" category.
Alternatively, view strip-indent alternatives based on common mentions on social networks and blogs.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of strip-indent or a related project?
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
const stripIndent = require('strip-indent'); const string = '\tunicorn\n\t\tcake'; /* unicorn cake */ stripIndent(string); /* unicorn cake */
Get professional support for this package with a Tidelift subscription Tidelift helps make open source sustainable for maintainers while giving companiesassurances about security, maintenance, and licensing for their dependencies.