v1.1.0 ยท zero dependencies ยท fully typed

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.

$ npm install @ppabari/strio
example.ts
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'
60+
string utilities
0
runtime dependencies
9
utility categories
100%
TypeScript typed
Why strio

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.

The toolkit

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

ensureLeftensureRight

Ship strings with confidence

Secure by default, ergonomic by design, zero dependencies always.