Product Brochure Layout
Discussion options

You must be logged in to vote

Create A Blog Page Readable.from() when passed a plain string treats the whole thing as a single chunk, so by the time you call .read(16) the internal buffer already has one 1,000,000-byte chunk in it and Node returns that whole chunk rather than slicing it. Email Bussiness Template

Happy Birthday Social Media Post The simplest fix is to slice the result after reading: Write A Blog Entry

const partialData = (readable.read(16) ?? '').slice(0, 16); console.log(partialData.length); // 16

Model Business Cards Or if you want a stream that genuinely yields data in controlled chunk sizes from the start, use a custom Readable that pushes in pieces: Cute Instagram Poses

import { Readable } from "node:stream"; function chunkedReadable(str, chunkSize) { let offset = 0; return new Readable({ read() { if (offset >= str.le…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ericmorand
Comment options

Example Of A Blog to join this conversation on CloneAGC. Already have an account? Bank Of America Platinum Credit Card