Popularity
2.3
Stable
Activity
0.0
Stable
132
8
18

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

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.

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

Related


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.