stream-url
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "stream-url", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"homepage": "http://github.com/gritzko/stream-url", | ||
@@ -23,2 +23,3 @@ "repository": { | ||
"dependencies": { | ||
"duplexify": "3.4.5" | ||
}, | ||
@@ -25,0 +26,0 @@ "devDependencies": { |
@@ -0,33 +1,6 @@ | ||
const duplexify = require('duplexify'); | ||
const Duplex = require('stream').Duplex; | ||
class Duplexer extends Duplex { | ||
constructor (reader, writer) { | ||
super({allowHalfOpen: false}); | ||
this.reader = reader; | ||
this.writer = writer; | ||
this._read_cb = data=>this.push(data); | ||
this._end_cb = ()=>this.push(null); | ||
this.reader.on('data', this._read_cb); | ||
this.reader.on('close', this._end_cb); | ||
} | ||
_write(chunk, encoding, callback) { | ||
console.log('W', chunk); | ||
this.writer.write(chunk, encoding, callback); | ||
} | ||
_read(size) { | ||
} | ||
end () { | ||
this.reader.pause(); | ||
super.end(); | ||
} | ||
} | ||
function std_listen (url, options, callback) { | ||
let stdio_stream = new Duplexer(process.stdin, process.stdout); | ||
let stdio_stream = duplexify (process.stdout, process.stdin); | ||
const serv = { | ||
@@ -45,3 +18,3 @@ on: function (evname, cb) { | ||
function std_connect (url, options, callback) { | ||
let stdio_stream = new Duplexer(process.stdin, process.stdout); | ||
let stdio_stream = duplexify (process.stdout, process.stdin); | ||
callback(null, stdio_stream); | ||
@@ -48,0 +21,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20130
1
523
+ Addedduplexify@3.4.5
+ Addedcore-util-is@1.0.3(transitive)
+ Addedduplexify@3.4.5(transitive)
+ Addedend-of-stream@1.0.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedonce@1.3.3(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstream-shift@1.0.3(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)