byteLength

abstract fun byteLength(string: PolyglotValue, encoding: String?): Int

Returns the length of a string when converted to bytes using the given encoding (defaults to UTF-8). Note that per the Node.js API documentation, string may also be a Buffer, ArrayBuffer, DataView, or TypedArray, in which case the value of the byteLength property is returned instead.