diff --git a/lib/core.js b/lib/core.js index 66e395d40..5590e8b58 100644 --- a/lib/core.js +++ b/lib/core.js @@ -58,6 +58,8 @@ var Archiver = function(format, options) { }; this._streams = []; + + this._loggedBulkDeprecation = false; }; inherits(Archiver, Transform); @@ -555,6 +557,16 @@ Archiver.prototype.append = function(source, data) { * @return {this} */ Archiver.prototype.bulk = function(mappings) { + if (!this._loggedBulkDeprecation) { + this._loggedBulkDeprecation = true; + var warning = 'Archiver.bulk() deprecated since 0.21.0'; + if (typeof process !== 'undefined' && typeof process.emitWarning !== 'undefined') { + process.emitWarning(warning, 'DeprecationWarning'); + } else { + console.warn(warning); + } + } + if (this._state.finalize || this._state.aborted) { this.emit('error', new Error('bulk: queue closed')); return this;