🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

read

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read - npm Package Compare versions

Comparing version

to
1.0.4

15

lib/read.js

@@ -26,3 +26,9 @@

var rlOpts = { input: input, output: output, terminal: terminal }
var rl = readline.createInterface(rlOpts)
if (process.version.match(/^v0\.6/)) {
var rl = readline.createInterface(rlOpts.input, rlOpts.output)
} else {
var rl = readline.createInterface(rlOpts)
}
var prompt = (opts.prompt || '').trim() + ' '

@@ -73,2 +79,9 @@ var silent = opts.silent

rl.close()
if (process.version.match(/^v0\.6/)) {
rl.input.removeAllListeners('data')
rl.input.removeAllListeners('keypress')
rl.input.pause()
}
clearTimeout(timer)

@@ -75,0 +88,0 @@ output.mute()

2

package.json
{
"name": "read",
"version": "1.0.3",
"version": "1.0.4",
"main": "lib/read.js",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -36,4 +36,19 @@ ## read

## COMPATIBILITY
This module works sort of with node 0.6. It does not work with node
versions less than 0.6. It is best on node 0.8.
On node version 0.6, it will remove all listeners on the input
stream's `data` and `keypress` events, because the readline module did
not fully clean up after itself in that version of node, and did not
make it possible to clean up after it in a way that has no potential
for side effects.
Additionally, some of the readline options (like `terminal`) will not
function in versions of node before 0.8, because they were not
implemented in the builtin readline module.
## CONTRIBUTING
Patches welcome.

@@ -8,2 +8,7 @@ var tap = require('tap')

var CLOSE = 'close'
if (process.version.match(/^v0\.6/)) {
CLOSE = 'exit'
}
var spawn = require('child_process').spawn

@@ -35,3 +40,3 @@

child.on('close', function () {
child.on(CLOSE, function () {
result = JSON.parse(result)

@@ -38,0 +43,0 @@ t.same(result, {"user":"a user","pass":"a password","verify":"a password","passMatch":true})

@@ -8,2 +8,7 @@ var tap = require('tap')

var CLOSE = 'close'
if (process.version.match(/^v0\.6/)) {
CLOSE = 'exit'
}
var spawn = require('child_process').spawn

@@ -35,3 +40,3 @@

child.on('close', function () {
child.on(CLOSE, function () {
result = JSON.parse(result)

@@ -38,0 +43,0 @@ t.same(result, {"user":"test-user","pass":"test-pass","verify":"test-pass","passMatch":true})

var tap = require('tap')
var read = require('../lib/read.js')
var CLOSE = 'close'
if (process.version.match(/^v0\.6/)) {
CLOSE = 'exit'
}
if (process.argv[2] === 'child') {

@@ -71,3 +76,3 @@ return child()

})
child.on('close', function (c) {
child.on(CLOSE, function (c) {
t.equal(output, expect)

@@ -74,0 +79,0 @@ t.equal(n, 19)