mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-17 23:45:29 -05:00
migrating from through to streams2
This commit is contained in:
parent
35235db7a0
commit
b7e4bfdd14
2 changed files with 43 additions and 0 deletions
38
lib/streams.js
Normal file
38
lib/streams.js
Normal file
|
@ -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;
|
||||
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue