Sha256: 89b5809b322d285b9d7a6fc56bfa2a39711ba5301ef0160c2beb8a4f361940ca

Contents?: true

Size: 695 Bytes

Versions: 40

Compression:

Stored size: 695 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 14.14.0 added fs.rm, which allows both the force and recursive options
const useNative = node.satisfies('>=14.14.0')

const rm = async (path, opts) => {
  const options = getOptions(opts, {
    copy: ['retryDelay', 'maxRetries', 'recursive', 'force'],
  })

  // 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.rm(path, options)
    : polyfill(path, options)
}

module.exports = rm

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.59 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.58 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.57 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.56 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.55 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.54 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.53 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.52 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.51 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.50 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.49 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.48 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.47 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.46 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.45 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.44 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.43 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.42 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js
immosquare-cleaner-0.1.41 node_modules/node-gyp/node_modules/make-fetch-happen/node_modules/cacache/node_modules/@npmcli/fs/lib/rm/index.js