Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gkovacs/read-each-line-sync
Read file line by line, synchronously.
https://github.com/gkovacs/read-each-line-sync
Last synced: about 2 months ago
JSON representation
Read file line by line, synchronously.
- Host: GitHub
- URL: https://github.com/gkovacs/read-each-line-sync
- Owner: gkovacs
- Created: 2014-12-19T23:28:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T14:59:25.000Z (almost 8 years ago)
- Last Synced: 2024-10-31T16:58:50.663Z (2 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# read-each-line-sync
Read file line by line, synchronously.
## Install
npm install read-each-line-sync
## Example
```javascript
var readEachLineSync = require('read-each-line-sync')readEachLineSync('test.txt', 'utf8', function(line) {
console.log(line)
})
```Encoding can optionally be omitted, in which case it will default to utf8:
```javascript
readEachLineSync('test.txt', function(line) {
console.log(line)
})
```End-Of-Line can be specified along with encoding if necessary, otherwise it defaults to your operating system EOF:
```javascript
readEachLineSync('test.txt', 'utf-8', '\n', function(line) {
console.log(line)
})
```## Credits
Author: [Geza Kovacs](http://github.com/gkovacs)
Based on [readLineSync](https://gist.github.com/Basemm/9700229)
## License
MIT