Secure strings & a 60-function
string toolkit.
Cryptographically secure generation โ tokens, IDs, passphrases, secrets โ plus a tree-shakeable toolkit of 60+ string utilities. One zero-dependency package for Node.js, browsers, Deno, Bun & edge.
import { generateId, generatePassphrase } from '@ppabari/strio';
import { slugify, camelize, pluralize } from '@ppabari/strio/str';
// Cryptographically secure โ bias-free Web Crypto
generateId({ prefix: 'usr' }); // โ 'usr_K3xP9mQr2L4Xc'
generatePassphrase({ words: 4 }); // โ 'stone-river-proud-flame'
// 60+ string utilities, tree-shakeable
slugify('Hรฉllo, World!'); // โ 'hello-world'
camelize('foo-bar_baz'); // โ 'fooBarBaz'
pluralize('child'); // โ 'children'
Batteries included, weight excluded
Everything you reach for when working with strings โ secure and ergonomic, without dragging in a dependency tree.
Cryptographically secure
Tokens, IDs, passphrases & secrets from a bias-free Web-Crypto engine. Even the random* string helpers use it โ never Math.random.
60+ string utilities
Manipulation, case conversion, validation, searching, formatting, padding, security & more โ each a pure, tree-shakeable named export.
Zero dependencies
No runtime deps. Ships ESM + CJS with complete .d.ts declarations and a tiny footprint.
Runs everywhere
Node.js โฅ18, modern browsers, Deno, Bun & edge runtimes โ with a built-in checkCompatibility() guard.
Tree-shakeable
Import only what you use from the /str subpath. Bundlers drop the rest โ pay only for the functions you call.
Fully typed & tested
Written in strict TypeScript with 300+ tests. Great autocomplete, precise return types, and a zod integration.
Nine categories, one import path
Everything below lives on @ppabari/strio/str. Full reference โ
๐ฏ Manipulation
capitalizereversetruncatetriminsertmask๐ค Case Conversion
camelizepascalizedasherizeunderscoreโ Validation
isEmptyisBlankisAlphaisNumericisUpperCase๐ Searching
containscontainsAllcountbetweenbetweenAll๐จ Formatting
humanizetitleCaseslugifyordinalizepluralize๐ ๏ธ Utilities
wordstemplaterandomsimilaritytransliterate๐ Padding
padLeftpadRightpadCenterindentdedent๐ Security
escapeHtmlescapeRegExpstripTagscollapseWhitespaceโจ Ensuring
ensureLeftensureRightShip strings with confidence
Secure by default, ergonomic by design, zero dependencies always.