diff --git a/lib/streams.js b/lib/streams.js new file mode 100644 index 000000000..1115771c7 --- /dev/null +++ b/lib/streams.js @@ -0,0 +1,38 @@ +var stream = require('stream'); +var util = require('util'); + +// +// This stream is used to read tarballs from repository +// +function ReadTarball(options) { + stream.PassThrough.call(this, options); +} + +// called when data is not needed anymore +UploadTarball.prototype.abort = function() { + this.emit('error', new Error('not implemented')); +}; + +util.inherits(ReadTarball, stream.PassThrough); +module.exports.ReadTarballStream = ReadTarball; + +// +// This stream is used to upload tarballs to a repository +// +function UploadTarball(options) { + stream.Writable.call(this, options); +} + +// called when user closes connection before upload finishes +UploadTarball.prototype.abort = function() { + this.emit('error', new Error('not implemented')); +}; + +// called when upload finishes successfully +UploadTarball.prototype.done = function() { + this.emit('error', new Error('not implemented')); +}; + +util.inherits(UploadTarball, stream.Writable); +module.exports.UploadTarballStream = UploadTarball; + diff --git a/package.yaml b/package.yaml index 086f6dc47..61fd567cd 100644 --- a/package.yaml +++ b/package.yaml @@ -43,6 +43,11 @@ keywords: scripts: test: ./test/start.sh +# we depend on streams2 stuff +# it can be replaced with isaacs/readable-stream, ask if you need to use 0.8 +engines: + node: '>=0.10' + preferGlobal: true license: BSD