Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/buffer.ts>Buffer.alloc

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method Buffer.alloc
import { Buffer } from "https://deno.land/std@0.104.0/node/buffer.ts";

Allocates a new Buffer of size bytes.

Parameters

size: number
optional
fill:
| number
| string
| Uint8Array
optional
encoding = [UNSUPPORTED]