@promistream/from-node-stream 0.1.6 → 0.1.7

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/package.json +1 -2
  2. package/src/index.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promistream/from-node-stream",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "main": "src/index.js",
5
5
  "repository": "https://codeberg.org/promistream/from-node-stream.git",
6
6
  "author": "Sven Slootweg <admin@cryto.net>",
@@ -17,7 +17,6 @@
17
17
  "@promistream/simple-sink": "^0.3.5",
18
18
  "@promistream/simple-source": "^0.1.10",
19
19
  "debug-instanced": "^1.0.0",
20
- "promisify-event": "^1.0.0",
21
20
  "push-buffer": "^1.5.7",
22
21
  "single-concurrent": "^1.0.0",
23
22
  "split-filter": "^1.1.3"
package/src/index.js CHANGED
@@ -11,7 +11,6 @@ const makeDebug = require("debug-instanced")("promistream:from-node-stream");
11
11
 
12
12
  const { once } = require("node:events");
13
13
  const pushBuffer = require("push-buffer");
14
- const promisifyEvent = require("promisify-event");
15
14
  const singleConcurrent = require("single-concurrent");
16
15
  const warning = require("@joepie91/warning");
17
16
  const util = require("node:util");
@@ -131,6 +130,7 @@ function wireWritable(debug, stream) {
131
130
  if (stream.writableNeedDrain) {
132
131
  /* Wait for the write buffer to be fully processed */
133
132
  // FIXME: Verify that this cannot cause a never-ending wait; if we wait to close the stream until it has drained, then during that time writes to it can continue to happen indefinitely, never letting it drain? Or is this prevented by the backpressure mechanisms we already have (re: .pause and .resume)?
133
+ debug("Waiting for internal write queue to drain...");
134
134
  await once(stream, "drain");
135
135
  }
136
136
  }
@@ -172,7 +172,7 @@ function wireWritable(debug, stream) {
172
172
 
173
173
  if (!canWriteMore) {
174
174
  debug("Stream is backlogged, waiting for drain event...");
175
- await promisifyEvent(stream, "drain");
175
+ await once(stream, "drain");
176
176
  debug("Drain event received");
177
177
  } else {
178
178
  debug("Write successful, can write more");