Popularity
2.0
Growing
Activity
4.0
Declining
86
7
13

Monthly Downloads: 0
Programming language: JavaScript
License: MIT License
Tags: Text     String     Str     Delete     Remove     Strip     Indent     Tab     Normalize     Space     Whitespace     Indentation    

strip-indent alternatives and similar modules

Based on the "Text" category

Do you think we are missing an alternative of strip-indent or a related project?

Add another 'Text' Module

README

strip-indent Build Status

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
*/

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.