diff --git a/lib/copy/copy-sync.js b/lib/copy/copy-sync.js index 5e245b91..551abe0c 100644 --- a/lib/copy/copy-sync.js +++ b/lib/copy/copy-sync.js @@ -17,8 +17,11 @@ function copySync (src, dest, opts) { // Warn about using preserveTimestamps on 32-bit node if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) + process.emitWarning( + 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', + 'Warning', 'fs-extra-WARN0002' + ) } const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts) diff --git a/lib/copy/copy.js b/lib/copy/copy.js index 2a2874f3..09d53dfd 100644 --- a/lib/copy/copy.js +++ b/lib/copy/copy.js @@ -23,8 +23,11 @@ function copy (src, dest, opts, cb) { // Warn about using preserveTimestamps on 32-bit node if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) + process.emitWarning( + 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', + 'Warning', 'fs-extra-WARN0001' + ) } stat.checkPaths(src, dest, 'copy', opts, (err, stats) => {