@foxscore/foreachline

1.0.0 • Public • Published

forEachLine

This library exports a function, not an object

Reads a file and executes some code for each line in the file.

Usage

const forEachLine = require('@foxscore/forEachLine')

forEachLine(
    './example.txt',
    (line) => {
        // Do something
    },
    { encoding: 'UTF-8' }
)

Arguments

Path

Where the file being accessed is located.

onLine

A function that gets executed for every line in the given file.

Options

encoding
Default UTF-8
Description Which encoding format should be used to read the file

Readme

Keywords

Package Sidebar

Install

npm i @foxscore/foreachline

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

2.07 kB

Total Files

4

Last publish

Collaborators

  • foxscore