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, smart, & global CDN for modern(es2015+) web development.
Latest
method Buffer.byteLength
import { Buffer } from "https://deno.land/x/esm@v135_2/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