Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

strip-indent

3.0.0 • Public • Published

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

License

MIT © Sindre Sorhus

Install

npm i strip-indent

DownloadsWeekly Downloads

15,242,981

Version

3.0.0

License

MIT

Unpacked Size

3.31 kB

Total Files

5

Last publish

Collaborators

  • avatar