Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/esm/server/embed/types/node.ns.d.ts>Buffer#slice

A fast, global content delivery network for ES Modules.
Go to Latest
method Buffer.prototype.slice
import { Buffer } from "https://deno.land/x/esm@v97/server/embed/types/node.ns.d.ts";

Returns a new Buffer that references the same memory as the original, but offset and cropped by the start and end indices.

This method is incompatible with Uint8Array#slice(), which returns a copy of the original memory.

Parameters

optional
begin: number

Where the new Buffer will start. Default: 0.

optional
end: number

Where the new Buffer will end (not inclusive). Default: buf.length.

Returns

Buffer