4.0.0 • Published 2 years ago

first-line v4.0.0

Weekly downloads
9
License
MIT
Repository
github
Last release
2 years ago

first-line

Get the first line of a file.

Example

$ cat fixture.txt
1
2
3
var firstLine = require('first-line');
var path = require('path');

var p = path.resolve(__dirname, 'fixture.txt');

firstLine(p, function(error, line) {
  if (error) {
    throw error;
  }

  console.log(line.toString());
  // => '1'
});

Installation

$ npm install first-line

API

var firstLine = require('first-line');

firstLine(file, callback)

Reads the file at String file and calls callback(error, line), where error is any Error encountered and line is a Buffer of the first line of file.

4.0.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

11 years ago

1.0.0

11 years ago