REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.80 KB
Close
/home/byroehnu/easepay.easetack.com/node_modules/stdin-discarder/index.js
Text
Base64
import process from 'node:process'; import readline from 'node:readline'; import {BufferListStream} from 'bl'; const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code class StdinDiscarder { #requests = 0; #mutedStream = new BufferListStream(); #ourEmit; #rl; constructor() { this.#mutedStream.pipe(process.stdout); const self = this; // eslint-disable-line unicorn/no-this-assignment this.#ourEmit = function (event, data, ...arguments_) { const {stdin} = process; if (self.#requests > 0 || stdin.emit === self.#ourEmit) { if (event === 'keypress') { // Fixes readline behavior return; } if (event === 'data' && data.includes(ASCII_ETX_CODE)) { process.emit('SIGINT'); } Reflect.apply(self.#ourEmit, this, [event, data, ...arguments_]); } else { Reflect.apply(process.stdin.emit, this, [event, data, ...arguments_]); } }; } start() { this.#requests++; if (this.#requests === 1) { this._realStart(); } } stop() { if (this.#requests <= 0) { throw new Error('`stop` called more times than `start`'); } this.#requests--; if (this.#requests === 0) { this._realStop(); } } // TODO: Use private methods when targeting Node.js 14. _realStart() { // No known way to make it work reliably on Windows if (process.platform === 'win32') { return; } this.#rl = readline.createInterface({ input: process.stdin, output: this.#mutedStream, }); this.#rl.on('SIGINT', () => { if (process.listenerCount('SIGINT') === 0) { process.emit('SIGINT'); } else { this.#rl.close(); process.kill(process.pid, 'SIGINT'); } }); } _realStop() { if (process.platform === 'win32') { return; } this.#rl.close(); this.#rl = undefined; } } const stdinDiscarder = new StdinDiscarder(); export default stdinDiscarder;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
.htaccess
127 B
lr--r--r--
2026-03-14 01:49:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.d.ts
166 B
lrw-r--r--
2026-02-28 00:27:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.80 KB
lrw-r--r--
2026-02-28 00:26:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
license
1.09 KB
lrw-r--r--
2026-02-28 00:26:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
813 B
lrw-r--r--
2026-02-28 00:26:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
readme.md
944 B
lrw-r--r--
2026-02-28 00:27:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).