How to use stream-concat - 1 common examples

To help you get started, we’ve selected a few stream-concat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CGamesPlay / chronicler / src / main / ElectronRequestConnector.js View on Github external
}
      }, 0);
      let currentIdx = -1;
      const nextStream = () => {
        currentIdx += 1;
        if (currentIdx === uploads.length) return null;
        const chunk = uploads[currentIdx];
        if (chunk.bytes) {
          return intoStream(chunk.bytes);
        } else if (chunk.file) {
          return fs.createReadStream(chunk.file);
        } else {
          throw new Error("not implemented");
        }
      };
      const stream = new StreamConcat(nextStream);
      return { contentLength, stream };
    });
  }

stream-concat

Simple and efficient node stream concatenation.

MIT
Latest version published 8 months ago

Package Health Score

55 / 100
Full package analysis

Popular stream-concat functions