New Functions
Enhanced Trimming (~270 bytes)
| Function |
Description |
Example |
trim |
Remove custom chars from both ends |
trim('///path///', '/') → 'path' |
trimStart |
Remove custom chars from start |
trimStart('///path', '/') → 'path' |
trimEnd |
Remove custom chars from end |
trimEnd('path///', '/') → 'path' |
String Masking (~200 bytes)
mask('4532123456789010') // '************9010'
mask('john@example.com', { showStart: true }) // 'john************'
mask('secret', { maskChar: '•' }) // '••cret'
Word Wrapping (~190 bytes)
wrap('Hello world, how are you today?', 15)
// 'Hello world,\nhow are you\ntoday?'
Bundle Size
| Bundle |
Size |
Limit |
| ESM |
9.63 KB |
12 KB ✅ |
| CJS |
10.3 KB |
12.5 KB ✅ |
Full Changelog
https://github.com/Zheruel/nano-string-utils/blob/main/CHANGELOG.md#0280---2026-01-23