bare-tty 5.1.0 → 5.1.1
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.
- package/index.js +14 -7
- package/package.json +5 -2
- package/prebuilds/android-arm/bare-tty.bare +0 -0
- package/prebuilds/android-arm64/bare-tty.bare +0 -0
- package/prebuilds/android-ia32/bare-tty.bare +0 -0
- package/prebuilds/android-x64/bare-tty.bare +0 -0
- package/prebuilds/darwin-arm64/bare-tty.bare +0 -0
- package/prebuilds/darwin-x64/bare-tty.bare +0 -0
- package/prebuilds/ios-arm64/bare-tty.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-tty.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-tty.bare +0 -0
- package/prebuilds/linux-arm64/bare-tty.bare +0 -0
- package/prebuilds/linux-x64/bare-tty.bare +0 -0
- package/prebuilds/win32-arm64/bare-tty.bare +0 -0
- package/prebuilds/win32-x64/bare-tty.bare +0 -0
package/index.js
CHANGED
|
@@ -108,6 +108,7 @@ exports.WriteStream = class TTYWriteStream extends Writable {
|
|
|
108
108
|
this._size = null
|
|
109
109
|
|
|
110
110
|
this._pendingWrite = null
|
|
111
|
+
this._pendingWriteBatch = null
|
|
111
112
|
this._pendingDestroy = null
|
|
112
113
|
|
|
113
114
|
this._handle = binding.init(fd, empty, this, this._onwrite, noop, this._onclose)
|
|
@@ -140,12 +141,17 @@ exports.WriteStream = class TTYWriteStream extends Writable {
|
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
_writev(batch, cb) {
|
|
143
|
-
this._pendingWrite =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
this._pendingWrite = cb
|
|
145
|
+
this._pendingWriteBatch = batch
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
binding.writev(
|
|
149
|
+
this._handle,
|
|
150
|
+
batch.map(({ chunk }) => chunk)
|
|
151
|
+
)
|
|
152
|
+
} catch (err) {
|
|
153
|
+
this._continueWrite(err)
|
|
154
|
+
}
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
_predestroy() {
|
|
@@ -174,8 +180,9 @@ exports.WriteStream = class TTYWriteStream extends Writable {
|
|
|
174
180
|
|
|
175
181
|
_continueWrite(err) {
|
|
176
182
|
if (this._pendingWrite === null) return
|
|
177
|
-
const cb = this._pendingWrite
|
|
183
|
+
const cb = this._pendingWrite
|
|
178
184
|
this._pendingWrite = null
|
|
185
|
+
this._pendingWriteBatch = null
|
|
179
186
|
cb(err)
|
|
180
187
|
}
|
|
181
188
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bare-tty",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"description": "Native TTY streams for JavaScript",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
],
|
|
22
22
|
"addon": true,
|
|
23
23
|
"scripts": {
|
|
24
|
-
"
|
|
24
|
+
"format": "prettier --write . && lunte --fix",
|
|
25
|
+
"lint": "prettier --check . && lunte",
|
|
26
|
+
"test": "brittle-bare --coverage test.js"
|
|
25
27
|
},
|
|
26
28
|
"repository": {
|
|
27
29
|
"type": "git",
|
|
@@ -44,6 +46,7 @@
|
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"brittle": "^3.2.1",
|
|
46
48
|
"cmake-bare": "^1.1.6",
|
|
49
|
+
"lunte": "^1.8.0",
|
|
47
50
|
"prettier": "^3.4.1",
|
|
48
51
|
"prettier-config-holepunch": "^2.0.0"
|
|
49
52
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|