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.byteLength

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

Gives the actual byte length of a string. encoding defaults to 'utf8'. This is not the same as String.prototype.length since that returns the number of characters in a string.

Parameters

string:
| string
| NodeJS.ArrayBufferView
| ArrayBuffer
| SharedArrayBuffer

string to test.

optional
encoding: BufferEncoding

encoding used to evaluate (defaults to 'utf8')

Returns

number