aboutsummaryrefslogtreecommitdiff
path: root/node_modules/fs-extra/lib/fs/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/fs-extra/lib/fs/index.js')
-rw-r--r--node_modules/fs-extra/lib/fs/index.js12
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 => {