bare-tty 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +5 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -39,6 +39,10 @@ exports.ReadStream = class TTYReadStream extends Readable {
39
39
  binding.setMode(this._handle, mode)
40
40
  }
41
41
 
42
+ setRawMode (mode) {
43
+ this.setMode(mode ? constants.MODE_RAW : constants.MODE_NORMAL)
44
+ }
45
+
42
46
  _read (cb) {
43
47
  if (!this._reading) {
44
48
  this._reading = true
@@ -211,7 +215,7 @@ exports.WriteStream = class TTYWriteStream extends Writable {
211
215
 
212
216
  exports.isTTY = binding.isTTY
213
217
 
214
- exports.constants = {
218
+ const constants = exports.constants = {
215
219
  MODE_NORMAL: binding.MODE_NORMAL,
216
220
  MODE_RAW: binding.MODE_RAW,
217
221
  MODE_IO: binding.MODE_IO || 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-tty",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "Native TTY streams for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [