Trim leading lines from a string when they are 100% whitespace or empty.
npm install trim-leading-linesTrim leading lines from a string when they are 100% whitespace or empty.
Install with npm:
``sh`
$ npm install --save trim-leading-lines
`js`
var trimLeadingLines = require('trim-leading-lines');
Example
Given the following in foo.txt:
``
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
This:
`js`
var str = fs.readFileSync('foo.txt', 'utf8');
console.log(trimLeadingLines(str));
Results in:
``
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
_(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)_
To generate the readme and API documentation with verb:
`sh`
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
`sh``
$ npm install -d && npm test
Jon Schlinkert
* github/jonschlinkert
* twitter/jonschlinkert
Copyright © 2016, Jon Schlinkert.
Released under the MIT license.
*
_This file was generated by verb, v0.9.0, on July 14, 2016._