trim-leading-lines

0.1.1 • Public • Published

trim-leading-lines NPM version NPM downloads Build Status

Trim leading lines from a string when they are 100% whitespace or empty.

Install

Install with npm:

$ npm install --save trim-leading-lines

Usage

var trimLeadingLines = require('trim-leading-lines');

Example

Given the following in foo.txt:

                  
                  
                  
                  
                    GNU AFFERO GENERAL PUBLIC LICENSE
                       Version 3, 19 November 2007

This:

var str = fs.readFileSync('foo.txt', 'utf8');
console.log(trimLeadingLines(str));

Results in:

                    GNU AFFERO GENERAL PUBLIC LICENSE
                       Version 3, 19 November 2007

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(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:

$ npm install -g verb verb-generate-readme && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on July 14, 2016.

Readme

Keywords

Package Sidebar

Install

npm i trim-leading-lines

Weekly Downloads

60,376

Version

0.1.1

License

MIT

Last publish

Collaborators

  • jonschlinkert