* 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
)
| 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 |
no outgoing calls
no test coverage detected