Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

readline

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

readline - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

package.json
{
"name": "readline",
"version": "0.0.5",
"version": "0.0.6",
"description": "Simple streaming readline module.",

@@ -5,0 +5,0 @@ "main": "readline.js",

@@ -16,13 +16,15 @@ var fs = require('fs'),

line = [],
emit = function(line) {
self.emit('line', new Buffer(line).toString());
lineCount = 0,
emit = function(line, count) {
self.emit('line', new Buffer(line).toString(), count);
};
fs.createReadStream(file).on('open', function(fd) {
self.emit('open', fd);
})
this.input = fs.createReadStream(file);
this.input.on('open', function(fd) {
self.emit('open', fd);
})
.on('data', function(data) {
for (var i = 0; i < data.length; i++) {
if (0 <= newlines.indexOf(data[i])) { // Newline char was found.
if (line.length) emit(line);
lineCount++;
if (line.length) emit(line, lineCount);
line = []; // Empty buffer.

@@ -39,3 +41,3 @@ } else {

// Emit last line if anything left over since EOF won't trigger it.
if (line.length) emit(line);
if (line.length) emit(line, lineCount);
self.emit('end');

@@ -42,0 +44,0 @@ })

@@ -6,4 +6,6 @@ ## _readline_

## Important. In node 10 there is a core module named readline. Please use linebyline instead, it is the same module just renamed
```sh
npm install readline
npm install linebyline
```

@@ -17,3 +19,3 @@

```js
var readline = require('readline'),
var readline = require('linebyline'),
rl = readline('./somefile.txt');

@@ -20,0 +22,0 @@ rl.on('line', function(line) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc