deepsea ca9f471156 first commit | il y a 1 an | |
---|---|---|
.. | ||
index.js | il y a 1 an | |
license | il y a 1 an | |
package.json | il y a 1 an | |
readme.md | il y a 1 an |
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 --save strip-indent
const stripIndent = require('strip-indent');
const str = '\tunicorn\n\t\tcake';
/*
unicorn
cake
*/
stripIndent('\tunicorn\n\t\tcake');
/*
unicorn
cake
*/
MIT © Sindre Sorhus