Download web/node_modules/get-stream/source/buffer.js from amitesh11/pose: direct link, hf CLI and curl.
- Browser
- Download file 606 Bytes
-
https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/node_modules/get-stream/source/buffer.js
- Command line
-
hf download hf://spaces/amitesh11/pose/web/node_modules/get-stream/source/buffer.js
-
curl -L -o buffer.js https://huggingface.co/spaces/amitesh11/pose/resolve/main/web/node_modules/get-stream/source/buffer.js
606 Bytes
| import {getStreamAsArrayBuffer} from './array-buffer.js'; | |
| export async function getStreamAsBuffer(stream, options) { | |
| if (!('Buffer' in globalThis)) { | |
| throw new Error('getStreamAsBuffer() is only supported in Node.js'); | |
| } | |
| try { | |
| return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options)); | |
| } catch (error) { | |
| if (error.bufferedData !== undefined) { | |
| error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData); | |
| } | |
| throw error; | |
| } | |
| } | |
| // eslint-disable-next-line n/prefer-global/buffer | |
| const arrayBufferToNodeBuffer = arrayBuffer => globalThis.Buffer.from(arrayBuffer); | |