JavaScript

StringZilla for JavaScript

npm install stringzilla 6.0.0-rc.1 · 91a27bdd

Byte offsets, counts, hashes, and sums are returned as BigInt values, suffixed with n, because they are 64-bit on the native side.

Topics

Installation
Types40
Searching and Counting1find and findLast locate a needle Buffer inside a haystack Buffer, returning the byte offset as a BigInt, or -1n when absent.
Comparison and Equalityequal reports whether two buffers hold identical bytes, returning a JavaScript boolean.
Unicode Segmentation4Four iterable classes lazily split a UTF-8 buffer into TR29 and UAX14 segments: Utf8Wordbreaks for words, Utf8Graphemes for grapheme clusters, Utf8Sentences for sentences, and Utf8Linebreaks for line-break opportunities.
Case Folding and Normalization5These functions operate on UTF-8 encoded buffers and apply full Unicode case folding.
Hashing and Checksums12hash computes StringZilla's fast 64-bit hash of a buffer, returned as a BigInt.
Runtime Dispatch12