JSPM

for-each-line

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q29529F
  • License MIT

Read a text file line by line, calls a callback, returns a promise that is resolved when file is completed

Package Exports

  • for-each-line

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (for-each-line) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

for-each-line

Read a text file line by line, calls a callback, returns a promise that is resolved when file is completed

usage

let forEachLine = require('for-each-line');

forEachLine(fileName, (line) => {
  console.log(line);
}).then(() => {
  console.log('Done!')
});

why?

I've been copy-pasting this code over and over, and I got tired of it it. So created this module. It's only 26 lines.

license

MIT