diff --git a/benchmark/common.js b/benchmark/common.js index 52dfb4011..667c741cd 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -1,5 +1,5 @@ function binaryBuffer(n) { - var buffer = new Buffer(n); + var buffer = Buffer.alloc(n); for (var i = 0; i < n; i++) { buffer.writeUInt8(i&255, i); diff --git a/lib/core.js b/lib/core.js index 8ca545690..f74248859 100644 --- a/lib/core.js +++ b/lib/core.js @@ -8,7 +8,6 @@ var fs = require('fs'); var glob = require('glob'); var async = require('async'); -var _ = { extend: require('lodash.assign') }; var path = require('path'); var util = require('archiver-utils'); @@ -639,7 +638,7 @@ Archiver.prototype.directory = function(dirpath, destpath, data) { function onGlobMatch(match){ var ignoreMatch = false; - var entryData = _.extend({}, data); + var entryData = Object.assign({}, data); entryData.name = match; entryData.prefix = destpath; match = globber._makeAbs(match); @@ -729,7 +728,7 @@ Archiver.prototype.glob = function(pattern, options, data) { } function onGlobMatch(match){ - var entryData = _.extend({}, data); + var entryData = Object.assign({}, data); if (options.cwd) { entryData.name = match; diff --git a/package.json b/package.json index f9638d95d..c8ea1f962 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "lib" ], "engines": { - "node": ">= 4" + "node": ">= 6" }, "scripts": { "test": "mocha --reporter dot", @@ -33,7 +33,6 @@ "async": "^2.0.0", "buffer-crc32": "^0.2.1", "glob": "^7.0.0", - "lodash.assign": "^4.2.0", "readable-stream": "^2.0.0", "tar-stream": "^1.5.0", "zip-stream": "^1.2.0" diff --git a/test/helpers/index.js b/test/helpers/index.js index 22957fa74..05cb597ad 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -21,7 +21,7 @@ function adjustDateByOffset(d, offset) { module.exports.adjustDateByOffset = adjustDateByOffset; function binaryBuffer(n) { - var buffer = new Buffer(n); + var buffer = Buffer.alloc(n); for (var i = 0; i < n; i++) { buffer.writeUInt8(i&255, i); @@ -35,7 +35,7 @@ module.exports.binaryBuffer = binaryBuffer; function BinaryStream(size, options) { Readable.call(this, options); - var buf = new Buffer(size); + var buf = Buffer.alloc(size); for (var i = 0; i < size; i++) { buf.writeUInt8(i&255, i);