REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.64 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/winston/lib/winston/tail-file.js
Text
Base64
/** * tail-file.js: TODO: add file header description. * * (C) 2010 Charlie Robbins * MIT LICENCE */ 'use strict'; const fs = require('fs'); const { StringDecoder } = require('string_decoder'); const { Stream } = require('readable-stream'); /** * Simple no-op function. * @returns {undefined} */ function noop() {} /** * TODO: add function description. * @param {Object} options - Options for tail. * @param {function} iter - Iterator function to execute on every line. * `tail -f` a file. Options must include file. * @returns {mixed} - TODO: add return description. */ module.exports = (options, iter) => { const buffer = Buffer.alloc(64 * 1024); const decode = new StringDecoder('utf8'); const stream = new Stream(); let buff = ''; let pos = 0; let row = 0; if (options.start === -1) { delete options.start; } stream.readable = true; stream.destroy = () => { stream.destroyed = true; stream.emit('end'); stream.emit('close'); }; fs.open(options.file, 'a+', '0644', (err, fd) => { if (err) { if (!iter) { stream.emit('error', err); } else { iter(err); } stream.destroy(); return; } (function read() { if (stream.destroyed) { fs.close(fd, noop); return; } return fs.read(fd, buffer, 0, buffer.length, pos, (error, bytes) => { if (error) { if (!iter) { stream.emit('error', error); } else { iter(error); } stream.destroy(); return; } if (!bytes) { if (buff) { // eslint-disable-next-line eqeqeq if (options.start == null || row > options.start) { if (!iter) { stream.emit('line', buff); } else { iter(null, buff); } } row++; buff = ''; } return setTimeout(read, 1000); } let data = decode.write(buffer.slice(0, bytes)); if (!iter) { stream.emit('data', data); } data = (buff + data).split(/\n+/); const l = data.length - 1; let i = 0; for (; i < l; i++) { // eslint-disable-next-line eqeqeq if (options.start == null || row > options.start) { if (!iter) { stream.emit('line', data[i]); } else { iter(null, data[i]); } } row++; } buff = data[l]; pos += bytes; return read(); }); }()); }); if (!iter) { return stream; } return stream.destroy; };
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
config
DIR
-
drwxr-xr-x
2026-02-21 00:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
transports
DIR
-
drwxr-xr-x
2026-02-21 00:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
common.js
1016 B
lrw-r--r--
2026-02-21 00:53:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
container.js
3.28 KB
lrw-r--r--
2026-02-21 00:53:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
create-logger.js
3.07 KB
lrw-r--r--
2026-02-21 00:53:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
exception-handler.js
6.75 KB
lrw-r--r--
2026-02-21 00:53:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
exception-stream.js
1.47 KB
lrw-r--r--
2026-02-21 00:53:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
logger.js
20.04 KB
lrw-r--r--
2026-02-21 00:53:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
profiler.js
1.38 KB
lrw-r--r--
2026-02-21 00:53:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rejection-handler.js
6.82 KB
lrw-r--r--
2026-02-21 00:53:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rejection-stream.js
1.32 KB
lrw-r--r--
2026-02-21 00:53:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tail-file.js
2.64 KB
lrw-r--r--
2026-02-21 00:53:58
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).