caoge c760052ff9 机车状态修改 | пре 8 месеци | |
---|---|---|
.. | ||
cli.js | пре 8 месеци | |
index.js | пре 8 месеци | |
license | пре 8 месеци | |
package.json | пре 8 месеци | |
readme.md | пре 8 месеци |
Strip leading whitespace from every 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
var str = '\tunicorn\n\t\tcake';
/*
unicorn
cake
*/
stripIndent('\tunicorn\n\t\tcake');
/*
unicorn
cake
*/
$ npm install --global strip-indent
$ strip-indent --help
Usage
strip-indent <file>
echo <string> | strip-indent
Example
echo '\tunicorn\n\t\tcake' | strip-indent
unicorn
cake
MIT © Sindre Sorhus