Socket
Socket
Sign inDemoInstall

mute-stream

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4

19

mute.js

@@ -14,2 +14,8 @@ var Stream = require('stream')

this.replace = opts.replace
// For readline-type situations
// This much at the start of a line being redrawn after a ctrl char
// is seen (such as backspace) won't be redrawn as the replacement
this._prompt = opts.prompt || null
this._hadControl = false
}

@@ -98,3 +104,14 @@

if (!this.replace) return true
c = c.toString().replace(/./g, this.replace)
if (c.match(/^\u001b/)) {
this._hadControl = true
return this.emit('data', c)
} else {
if (this._prompt && this._hadControl &&
c.indexOf(this._prompt) === 0) {
this._hadControl = false
this.emit('data', this._prompt)
c = c.substr(this._prompt.length)
}
c = c.toString().replace(/./g, this.replace)
}
}

@@ -101,0 +118,0 @@ this.emit('data', c)

2

package.json
{
"name": "mute-stream",
"version": "0.0.3",
"version": "0.0.4",
"main": "mute.js",

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

@@ -45,2 +45,8 @@ # mute-stream

* `prompt` If you are using a replacement char, and also using a
prompt with a readline stream (as for a `Password: *****` input),
then specify what the prompt is so that backspace will work
properly. Otherwise, pressing backspace will overwrite the prompt
with the replacement character, which is weird.
## ms.mute()

@@ -47,0 +53,0 @@

@@ -22,2 +22,3 @@ var Stream = require('stream')

this.emit('data', c)
return true
}

@@ -24,0 +25,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc