PHP 8.2.30
Preview: with-owner.js Size: 495 B
/proc/self/root/opt/alt/alt-nodejs16/root/usr/lib/node_modules/npm/node_modules/@npmcli/fs/lib/with-owner.js

const getOptions = require('./common/get-options.js')
const owner = require('./common/owner.js')

const withOwner = async (path, fn, opts) => {
  const options = getOptions(opts, {
    copy: ['owner'],
  })

  const { uid, gid } = await owner.validate(path, options.owner)

  const result = await fn({ uid, gid })

  await Promise.all([
    owner.update(path, uid, gid),
    typeof result === 'string' ? owner.update(result, uid, gid) : null,
  ])

  return result
}

module.exports = withOwner

Directory Contents

Dirs: 3 × Files: 10

Name Size Perms Modified Actions
common DIR
- drwxr-xr-x 2026-04-08 07:02:23
Edit Download
cp DIR
- drwxr-xr-x 2026-04-08 07:02:23
Edit Download
rm DIR
- drwxr-xr-x 2026-04-08 07:02:23
Edit Download
494 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
3.32 KB lrw-r--r-- 2026-03-17 06:55:04
Edit Download
660 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
395 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
435 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
777 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
463 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
495 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
1021 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download
395 B lrw-r--r-- 2026-03-17 06:55:04
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).