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

std/node/buffer.ts>Buffer#toJSON

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

Returns a JSON representation of buf. JSON.stringify() implicitly calls this function when stringifying a Buffer instance.

Returns

Record<string, unknown>