Skip to main content
Glama
buffer.js606 B
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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mnehmos/mnehmos.synch.mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server