Skip to main content
Module

x/mysql2/index.d.ts>Buffer.isEncoding

MySQL client for Deno with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression much more
Latest
method Buffer.isEncoding
Re-export
import { Buffer } from "https://deno.land/x/mysql2@v1.0.6/index.d.ts";

Returns true if encoding is the name of a supported character encoding, or false otherwise.

import { Buffer } from 'buffer';

console.log(Buffer.isEncoding('utf8'));
// Prints: true

console.log(Buffer.isEncoding('hex'));
// Prints: true

console.log(Buffer.isEncoding('utf/8'));
// Prints: false

console.log(Buffer.isEncoding(''));
// Prints: false

Parameters

encoding: string

A character encoding name to check.

Returns

boolean