Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 844 Bytes

readme.md

File metadata and controls

44 lines (27 loc) · 844 Bytes

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 --save strip-indent

Usage

const stripIndent = require('strip-indent');

const str = '\tunicorn\n\t\tcake';
/*
	unicorn
		cake
*/

stripIndent(str);
/*
unicorn
	cake
*/

Related

License

MIT © Sindre Sorhus