Sha256: 51b95449cef8ca6f9a64edd7f15cc877eb0c4bd57592328a50cc2840b207110a

Contents?: true

Size: 692 Bytes

Versions: 25

Compression:

Stored size: 692 Bytes

Contents

const fs = require('../fs.js')
const getOptions = require('../common/get-options.js')
const node = require('../common/node.js')
const polyfill = require('./polyfill.js')

// node 16.7.0 added fs.cp
const useNative = node.satisfies('>=16.7.0')

const cp = async (src, dest, opts) => {
  const options = getOptions(opts, {
    copy: ['dereference', 'errorOnExist', 'filter', 'force', 'preserveTimestamps', 'recursive'],
  })

  // the polyfill is tested separately from this module, no need to hack
  // process.version to try to trigger it just for coverage
  // istanbul ignore next
  return useNative
    ? fs.cp(src, dest, options)
    : polyfill(src, dest, options)
}

module.exports = cp

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.52 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.51 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.50 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.49 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.48 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.47 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.46 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.45 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.44 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.43 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.42 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.41 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.40 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.39 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.38 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.32 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.31 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.30 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.29 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js
immosquare-cleaner-0.1.28 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/cp/index.js