linux-device
Advanced tools
Comparing version 2.0.11 to 2.0.12
@@ -112,11 +112,9 @@ "use strict"; | ||
if(tty.isatty(this.fd)) { | ||
this[kSource].isTTY = true; | ||
if(this[kSource].readable) { | ||
this[kSource].inStream = new tty.ReadStream(this.fd); | ||
this[kSource].inStream.setRawMode(true); | ||
} | ||
if(this[kSource].writable) { | ||
this[kSource].outStream = new tty.WriteStream(this.fd); | ||
} | ||
//write uses writeRepeated instead of a stream | ||
} else { | ||
this[kSource].isTTY = false; | ||
const fstat = await fs.fstat(this.fd); | ||
@@ -287,4 +285,4 @@ if(fstat.isFile() || fstat.isCharacterDevice() || fstat.isBlockDevice() ) { | ||
if(!this[kSource].writable) throw new Error('not_writable'); | ||
if(chunk.interval && chunk.repetitions) { | ||
return await FH.writeRepeated(this.fd, chunk, chunk.interval, chunk.repetitions); //retain chunks | ||
if(this[kSource].isTTY || (chunk.interval && chunk.repetitions) ) { | ||
return await FH.writeRepeated(this.fd, chunk, chunk.interval || 0, chunk.repetitions || 1); //retain chunks | ||
} else { | ||
@@ -291,0 +289,0 @@ return util.promisify(this[kSource].outStream.write).call(this[kSource].outStream, chunk, encoding); //retain chunk |
{ | ||
"name": "linux-device", | ||
"version": "2.0.11", | ||
"version": "2.0.12", | ||
"description": "Native addon to communicate with linux devices (can also be used for sockets or FIFOs)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
1097387
1131