$94 GRAYBYTE WORDPRESS FILE MANAGER $83

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/tar/lib/

HOME
Current File : /opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/tar/lib//create.js
'use strict'

// tar -c
const hlo = require('./high-level-opt.js')

const Pack = require('./pack.js')
const fsm = require('fs-minipass')
const t = require('./list.js')
const path = require('path')

module.exports = (opt_, files, cb) => {
  if (typeof files === 'function') {
    cb = files
  }

  if (Array.isArray(opt_)) {
    files = opt_, opt_ = {}
  }

  if (!files || !Array.isArray(files) || !files.length) {
    throw new TypeError('no files or directories specified')
  }

  files = Array.from(files)

  const opt = hlo(opt_)

  if (opt.sync && typeof cb === 'function') {
    throw new TypeError('callback not supported for sync tar functions')
  }

  if (!opt.file && typeof cb === 'function') {
    throw new TypeError('callback only supported with file option')
  }

  return opt.file && opt.sync ? createFileSync(opt, files)
    : opt.file ? createFile(opt, files, cb)
    : opt.sync ? createSync(opt, files)
    : create(opt, files)
}

const createFileSync = (opt, files) => {
  const p = new Pack.Sync(opt)
  const stream = new fsm.WriteStreamSync(opt.file, {
    mode: opt.mode || 0o666,
  })
  p.pipe(stream)
  addFilesSync(p, files)
}

const createFile = (opt, files, cb) => {
  const p = new Pack(opt)
  const stream = new fsm.WriteStream(opt.file, {
    mode: opt.mode || 0o666,
  })
  p.pipe(stream)

  const promise = new Promise((res, rej) => {
    stream.on('error', rej)
    stream.on('close', res)
    p.on('error', rej)
  })

  addFilesAsync(p, files)

  return cb ? promise.then(cb, cb) : promise
}

const addFilesSync = (p, files) => {
  files.forEach(file => {
    if (file.charAt(0) === '@') {
      t({
        file: path.resolve(p.cwd, file.slice(1)),
        sync: true,
        noResume: true,
        onentry: entry => p.add(entry),
      })
    } else {
      p.add(file)
    }
  })
  p.end()
}

const addFilesAsync = (p, files) => {
  while (files.length) {
    const file = files.shift()
    if (file.charAt(0) === '@') {
      return t({
        file: path.resolve(p.cwd, file.slice(1)),
        noResume: true,
        onentry: entry => p.add(entry),
      }).then(_ => addFilesAsync(p, files))
    } else {
      p.add(file)
    }
  }
  p.end()
}

const createSync = (opt, files) => {
  const p = new Pack.Sync(opt)
  addFilesSync(p, files)
  return p
}

const create = (opt, files) => {
  const p = new Pack(opt)
  addFilesAsync(p, files)
  return p
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
1 Jan 1970 8.00 AM
root / root
0
create.js
2.339 KB
17 Jan 2026 1.16 AM
root / root
0644
extract.js
2.785 KB
17 Jan 2026 1.16 AM
root / root
0644
get-write-flag.js
0.899 KB
17 Jan 2026 1.16 AM
root / root
0644
header.js
8.939 KB
17 Jan 2026 1.16 AM
root / root
0644
high-level-opt.js
0.742 KB
17 Jan 2026 1.16 AM
root / root
0644
large-numbers.js
2.177 KB
17 Jan 2026 1.16 AM
root / root
0644
list.js
3.148 KB
17 Jan 2026 1.16 AM
root / root
0644
mkdir.js
5.356 KB
17 Jan 2026 1.16 AM
root / root
0644
mode-fix.js
0.634 KB
17 Jan 2026 1.16 AM
root / root
0644
normalize-unicode.js
0.402 KB
17 Jan 2026 1.16 AM
root / root
0644
normalize-windows-path.js
0.4 KB
17 Jan 2026 1.16 AM
root / root
0644
pack.js
9.786 KB
17 Jan 2026 1.16 AM
root / root
0644
parse.js
15.939 KB
17 Jan 2026 1.16 AM
root / root
0644
path-reservations.js
4.307 KB
17 Jan 2026 1.16 AM
root / root
0644
pax.js
3.973 KB
17 Jan 2026 1.16 AM
root / root
0644
read-entry.js
2.775 KB
17 Jan 2026 1.16 AM
root / root
0644
replace.js
5.641 KB
17 Jan 2026 1.16 AM
root / root
0644
strip-absolute-path.js
0.896 KB
17 Jan 2026 1.16 AM
root / root
0644
strip-trailing-slashes.js
0.385 KB
17 Jan 2026 1.16 AM
root / root
0644
types.js
1.07 KB
17 Jan 2026 1.16 AM
root / root
0644
unpack.js
25.229 KB
17 Jan 2026 1.16 AM
root / root
0644
update.js
0.915 KB
17 Jan 2026 1.16 AM
root / root
0644
warn-mixin.js
0.708 KB
17 Jan 2026 1.16 AM
root / root
0644
winchars.js
0.522 KB
17 Jan 2026 1.16 AM
root / root
0644
write-entry.js
14.941 KB
17 Jan 2026 1.16 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF