Skip to content

Commit

Permalink
Merge pull request #380 from jprichardson/copy-file-sync-update-Buffe…
Browse files Browse the repository at this point in the history
…r-alloc

Use Buffer.alloc() instead of deprecated new Buffer() in copy-file-sync
  • Loading branch information
jprichardson committed Mar 7, 2017
2 parents e06440b + 5597bd5 commit 9bef553
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/copy-sync/copy-file-sync.js
Expand Up @@ -3,7 +3,7 @@
const fs = require('graceful-fs')

const BUF_LENGTH = 64 * 1024
const _buff = new Buffer(BUF_LENGTH)
const _buff = Buffer.alloc(BUF_LENGTH)

function copyFileSync (srcFile, destFile, options) {
const overwrite = options.overwrite
Expand Down
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -56,5 +56,8 @@
"test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha",
"test": "npm run lint && npm run unit",
"unit": "node test.js"
},
"engines": {
"node": ">=4.5.0"
}
}

0 comments on commit 9bef553

Please sign in to comment.