Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/cli.js>stringWidth

A JavaScript extension package for building strong and modern applications.
Latest
function stringWidth
import { stringWidth } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/cli.js";

Returns the width of a string.

Examples

Example 1

import { stringWidth } from "@ayonli/jsext/cli";

console.log(stringWidth("Hello, World!")); // 13
console.log(stringWidth("你好,世界!")); // 12
console.log(stringWidth("👋🌍🚀♥️♣")); // 8