$27 GRAYBYTE WORDPRESS FILE MANAGER $33

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/@npmcli/fs/lib/

HOME
Current File : /opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/@npmcli/fs/lib//with-temp-dir.js
const { join, sep } = require('path')

const getOptions = require('./common/get-options.js')
const { mkdir, mkdtemp, rm } = require('fs/promises')

// create a temp directory, ensure its permissions match its parent, then call
// the supplied function passing it the path to the directory. clean up after
// the function finishes, whether it throws or not
const withTempDir = async (root, fn, opts) => {
  const options = getOptions(opts, {
    copy: ['tmpPrefix'],
  })
  // create the directory
  await mkdir(root, { recursive: true })

  const target = await mkdtemp(join(`${root}${sep}`, options.tmpPrefix || ''))
  let err
  let result

  try {
    result = await fn(target)
  } catch (_err) {
    err = _err
  }

  try {
    await rm(target, { force: true, recursive: true })
  } catch {
    // ignore errors
  }

  if (err) {
    throw err
  }

  return result
}

module.exports = withTempDir

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
common
--
16 Mar 2026 5.04 PM
root / root
0755
cp
--
16 Mar 2026 5.04 PM
root / root
0755
index.js
0.262 KB
17 Jan 2026 1.16 AM
root / root
0644
move-file.js
2.228 KB
17 Jan 2026 1.16 AM
root / root
0644
readdir-scoped.js
0.421 KB
17 Jan 2026 1.16 AM
root / root
0644
with-temp-dir.js
0.879 KB
17 Jan 2026 1.16 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF