trim-leading-lines
Trim leading lines from a string when they are 100% whitespace or empty.
Last updated 10 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install trim-leading-lines 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.1.1                                ...           latest (10 years ago)

2 Versions

  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |