Server IP : 85.214.239.14 / Your IP : 3.137.210.133 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/3/cwd/usr/lib/node_modules/npm/node_modules/cacache/node_modules/tar/dist/esm/ |
Upload File : |
// tar -x import * as fsm from '@isaacs/fs-minipass'; import fs from 'node:fs'; import { filesFilter } from './list.js'; import { makeCommand } from './make-command.js'; import { Unpack, UnpackSync } from './unpack.js'; const extractFileSync = (opt) => { const u = new UnpackSync(opt); const file = opt.file; const stat = fs.statSync(file); // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation const readSize = opt.maxReadSize || 16 * 1024 * 1024; const stream = new fsm.ReadStreamSync(file, { readSize: readSize, size: stat.size, }); stream.pipe(u); }; const extractFile = (opt, _) => { const u = new Unpack(opt); const readSize = opt.maxReadSize || 16 * 1024 * 1024; const file = opt.file; const p = new Promise((resolve, reject) => { u.on('error', reject); u.on('close', resolve); // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation fs.stat(file, (er, stat) => { if (er) { reject(er); } else { const stream = new fsm.ReadStream(file, { readSize: readSize, size: stat.size, }); stream.on('error', reject); stream.pipe(u); } }); }); return p; }; export const extract = makeCommand(extractFileSync, extractFile, opt => new UnpackSync(opt), opt => new Unpack(opt), (opt, files) => { if (files?.length) filesFilter(opt, files); }); //# sourceMappingURL=extract.js.map