Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anvaka/for-each-line
Read a text file line by line, calls a callback, returns a promise that is resolved when file is completed
https://github.com/anvaka/for-each-line
Last synced: 8 days ago
JSON representation
Read a text file line by line, calls a callback, returns a promise that is resolved when file is completed
- Host: GitHub
- URL: https://github.com/anvaka/for-each-line
- Owner: anvaka
- License: mit
- Created: 2017-09-08T00:25:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-22T23:23:46.000Z (about 2 months ago)
- Last Synced: 2024-10-14T12:08:11.629Z (29 days ago)
- Language: JavaScript
- Size: 392 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
``` js
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