mute-stream

WebJar for mute-stream

Лицензия

Лицензия

ISC
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

mute-stream
Последняя версия

Последняя версия

0.0.8
Дата

Дата

Тип

Тип

jar
Описание

Описание

mute-stream
WebJar for mute-stream
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/npm/mute-stream

Скачать mute-stream

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mute-stream/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mute-stream</artifactId>
    <version>0.0.8</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mute-stream/
implementation 'org.webjars.npm:mute-stream:0.0.8'
// https://jarcasting.com/artifacts/org.webjars.npm/mute-stream/
implementation ("org.webjars.npm:mute-stream:0.0.8")
'org.webjars.npm:mute-stream:jar:0.0.8'
<dependency org="org.webjars.npm" name="mute-stream" rev="0.0.8">
  <artifact name="mute-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mute-stream', version='0.0.8')
)
libraryDependencies += "org.webjars.npm" % "mute-stream" % "0.0.8"
[org.webjars.npm/mute-stream "0.0.8"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

mute-stream

Bytes go in, but they don't come out (when muted).

This is a basic pass-through stream, but when muted, the bytes are silently dropped, rather than being passed through.

Usage

var MuteStream = require('mute-stream')

var ms = new MuteStream(options)

ms.pipe(process.stdout)
ms.write('foo') // writes 'foo' to stdout
ms.mute()
ms.write('bar') // does not write 'bar'
ms.unmute()
ms.write('baz') // writes 'baz' to stdout

// can also be used to mute incoming data
var ms = new MuteStream
input.pipe(ms)

ms.on('data', function (c) {
  console.log('data: ' + c)
})

input.emit('data', 'foo') // logs 'foo'
ms.mute()
input.emit('data', 'bar') // does not log 'bar'
ms.unmute()
input.emit('data', 'baz') // logs 'baz'

Options

All options are optional.

  • replace Set to a string to replace each character with the specified string when muted. (So you can show **** instead of the password, for example.)

  • 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()

Set muted to true. Turns .write() into a no-op.

ms.unmute()

Set muted to false

ms.isTTY

True if the pipe destination is a TTY, or if the incoming pipe source is a TTY.

Other stream methods...

The other standard readable and writable stream methods are all available. The MuteStream object acts as a facade to its pipe source and destination.

org.webjars.npm

npm

node package manager

Версии библиотеки

Версия
0.0.8
0.0.7
0.0.5
0.0.4