MCPcopy Create free account
hub / github.com/awslabs/llrt / alloc

Method alloc

types/buffer.d.ts:253–253  ·  view source on GitHub ↗

* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the `Buffer` will be zero-filled. * * ```js * import { Buffer } from 'buffer'; * * const buf = Buffer.alloc(5); * * console.log(buf); * // Prints: * ``` *

(
      size: number,
      fill?: string | Uint8Array | number,
      encoding?: BufferEncoding
    )

Source from the content-addressed store, hash-verified

251 * @param [encoding='utf8'] If `fill` is a string, this is its encoding.
252 */
253 alloc(
254 size: number,
255 fill?: string | Uint8Array | number,
256 encoding?: BufferEncoding

Callers 8

constructorMethod · 0.65
growMethod · 0.65
appendMethod · 0.65
buffer.test.tsFile · 0.65
crypto.test.tsFile · 0.65
sendFunction · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected