diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/fs-extra/lib/fs/index.js | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/fs-extra/lib/fs/index.js')
-rw-r--r-- | node_modules/fs-extra/lib/fs/index.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/node_modules/fs-extra/lib/fs/index.js b/node_modules/fs-extra/lib/fs/index.js index 551ca6a09..1821fd000 100644 --- a/node_modules/fs-extra/lib/fs/index.js +++ b/node_modules/fs-extra/lib/fs/index.js @@ -9,6 +9,7 @@ const api = [ 'chmod', 'chown', 'close', + 'copyFile', 'fchmod', 'fchown', 'fdatasync', @@ -20,6 +21,7 @@ const api = [ 'link', 'lstat', 'mkdir', + 'mkdtemp', 'open', 'readFile', 'readdir', @@ -33,9 +35,13 @@ const api = [ 'unlink', 'utimes', 'writeFile' -] -// fs.mkdtemp() was added in Node.js v5.10.0, so check if it exists -typeof fs.mkdtemp === 'function' && api.push('mkdtemp') +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) // Export all keys: Object.keys(fs).forEach(key => { |