@lucid-softworks/string-truncate
v0.1.0
Published
Unicode-safe string truncation with a configurable omission.
Maintainers
Readme
@lucid-softworks/string-truncate
Truncate text by Unicode code points. The omission counts toward the requested
maximum and defaults to ….
import { truncate } from "@lucid-softworks/string-truncate";
truncate("hello world", 6); // "hello…"
truncate("hello world", 7, "..."); // "hell..."