Skip to content

Releases: Zheruel/nano-string-utils

v0.16.0 - Text Processing Utilities

22 Sep 20:01
bd28f2d

Choose a tag to compare

What's New

🎉 New Functions (3)

extractEntities(text: string): ExtractedEntities

Extract various entities from text including:

  • 📧 Email addresses
  • 🔗 URLs
  • 🏷️ Social media mentions (@username)
  • #️⃣ Hashtags
  • 📱 Phone numbers
  • 📅 Dates (ISO, US, EU formats)
  • 💵 Prices

smartSplit(text: string): string[]

Intelligently split text into sentences with:

  • Abbreviation handling (Dr., Mr., Mrs., etc.)
  • Decimal number preservation ($10.50)
  • Ellipsis detection
  • Special case handling (U.S.A., M.I.T.)

humanizeList(items: unknown[], options?: HumanizeListOptions)

Convert arrays to human-readable lists:

  • Oxford comma support
  • Custom conjunctions (and/or)
  • Quote wrapping
  • Null/undefined filtering

📈 Changes

  • Bundle size limit increased from 6.5KB to 7.5KB
  • Total function count: 44
  • All functions maintain < 1.2KB individual size

📦 Install

```bash
npm install [email protected]
```

📚 Full Changelog

See CHANGELOG.md

v0.15.0 - CDN Optimization

21 Sep 12:35
0b83567

Choose a tag to compare

🚀 CDN Optimization Release

This release adds full support for using nano-string-utils directly from CDN services, making it easier than ever to use in browser environments without any build tools.

✨ What's New

CDN Support

  • IIFE Build Format - New browser-ready build that exposes nanoStringUtils global variable
  • CDN Configuration - Added unpkg, jsdelivr, and browser fields to package.json
  • Zero Build Tools Required - Use directly via <script> tags in HTML

📦 Usage

Via Script Tag

<script src="https://unpkg.com/[email protected]/dist/index.iife.js"></script>
<script>
  const slug = nanoStringUtils.slugify("Hello World!");
  console.log(slug); // 'hello-world'
</script>

Via ES Modules

<script type="module">
  import { slugify, camelCase } from 'https://unpkg.com/[email protected]/dist/index.js';
  
  console.log(slugify("Hello World")); // 'hello-world'
  console.log(camelCase("hello-world")); // 'helloWorld'
</script>

🏗️ Build Improvements

  • Triple output format: ESM, CommonJS, and IIFE
  • All builds are minified and tree-shaken
  • Source maps included for all formats
  • Bundle size remains under 6.5KB

📊 Stats

  • ESM: 6.01 KB (brotli compressed)
  • CJS: 6.41 KB (brotli compressed)
  • IIFE: ~19 KB (minified)
  • Functions: 41 utilities
  • Dependencies: Still zero! 🎉

🔗 CDN Links

📝 Full Changelog

See CHANGELOG.md for details.

v0.14.0: Full Deno and Bun Runtime Support

21 Sep 12:12

Choose a tag to compare

🚀 Full Deno and Bun Runtime Support

nano-string-utils now works seamlessly across all modern JavaScript runtimes: Node.js, Deno, and Bun!

✨ Highlights

  • 🦕 Deno Support: All 41 utility functions and CLI tool work natively in Deno
  • 🍞 Bun Support: Full compatibility with Bun runtime including performance optimizations
  • 🔧 Universal CLI: The nano-string CLI tool now runs in any runtime
  • ✅ Zero Breaking Changes: Existing Node.js users are unaffected
  • 📦 Zero Dependencies: Maintains our commitment to zero runtime dependencies

🎯 What's New

Runtime Abstraction Layer

  • Unified interface for cross-runtime compatibility
  • Automatic runtime detection (Node.js, Deno, or Bun)
  • Seamless stdin handling and path resolution across runtimes

Enhanced CLI Tool

  • Works with deno run, bun run, and Node.js execution
  • Full pipe support in all runtimes
  • Consistent behavior across all environments

Comprehensive Testing

  • Dedicated runtime compatibility tests for Deno and Bun
  • All 41 functions verified across runtimes
  • CI/CD pipeline extended with runtime compatibility checks

📖 Usage Examples

Deno:
```typescript
// Import from JSR
import { slugify } from "jsr:@zheruel/nano-string-utils";

// Or use the CLI
deno run --allow-read https://unpkg.com/nano-string-utils/bin/nano-string.js slugify "Hello Deno"
```

Bun:
```bash

Install and use

bun add nano-string-utils

Use the CLI

bunx nano-string-utils camelCase "hello-bun-world"
```

Node.js:
```bash

Works as always

npx nano-string-utils kebabCase "HelloWorld"
```

📊 Runtime Compatibility Matrix

Runtime Library CLI Installation
Node.js ≥18 `npm install nano-string-utils`
Deno `deno add @zheruel/nano-string-utils`
Bun `bun add nano-string-utils`

📦 Installation

NPM: `npm install [email protected]`
JSR: `deno add @zheruel/[email protected]`
Bun: `bun add [email protected]`

📚 Documentation

Full documentation and interactive playground: https://zheruel.github.io/nano-string-utils/


Full Changelog: https://github.com/Zheruel/nano-string-utils/blob/main/CHANGELOG.md#0140---2025-09-21

v0.13.0: Detailed Bundle Size Analysis

19 Sep 13:33
0455545

Choose a tag to compare

🚀 Release v0.13.0: Detailed Bundle Size Analysis

✨ What's New

📊 Comprehensive Bundle Size Analysis Tool

  • Per-function size comparison across all 41 utilities
  • Tree-shaking analysis showing both bundled and tree-shaken sizes
  • Side-by-side comparison with lodash and es-toolkit
  • Interactive visualization in documentation site

📈 Documentation Site Enhancements

  • New Bundle Size Viewer tab with:
    • Interactive sorting and filtering
    • Visual size comparison bars
    • Real-time search functionality
    • Winner indicators and savings percentages
  • Improved CSS architecture - consolidated stylesheets for better performance
  • Fixed TypeScript warnings in bundle-size.ts

📦 Bundle Size Metrics

  • 34 out of 41 functions win on bundle size
  • Average 52% size reduction compared to alternatives
  • Total library size: 6.41 kB (under 6.5 kB limit)

🔧 Technical Improvements

  • Automated function extraction from library exports
  • JSON and markdown report generation
  • Public data serving for documentation site
  • Enhanced benchmark infrastructure

📝 Full Changelog

See CHANGELOG.md for detailed changes.

📦 Installation

```bash
npm install [email protected]
```

🌐 Try It Out

Visit our interactive documentation to explore the new bundle size viewer!

v0.12.0 - CLI Tool

17 Sep 11:25
c0fc858

Choose a tag to compare

🎉 New Features

CLI Tool

Introducing a zero-dependency command-line interface for nano-string-utils! Now you can run all 40+ string utilities directly from your terminal.

Installation & Usage

# Global installation
npm install -g nano-string-utils
nano-string slugify "Hello World"

# Using npx (no installation required)
npx nano-string-utils slugify "Hello World"

Key Features

  • 🚀 Zero dependencies - Maintains our core philosophy
  • 🔧 All functions supported - Access to 40+ string utilities
  • 🔗 Pipe support - Unix-style command chaining
  • 📖 Comprehensive help - Global and per-function documentation
  • 🎯 Smart options - JSON support for complex data
  • Full test coverage - 39 CLI-specific test cases

Examples

# Simple transformations
nano-string slugify "Hello World\!"           # hello-world
nano-string camelCase "hello-world"          # helloWorld

# Using pipes
echo "Hello World" | nano-string kebabCase   # hello-world
cat file.txt | nano-string truncate --length 50

# Complex functions
nano-string template "Hello {{name}}" --data '{"name":"World"}'
nano-string truncate "Long text here" --length 10

# Validation with exit codes
nano-string isEmail "[email protected]"       # true (exit 0)

What's Changed

  • Added CLI implementation in bin/nano-string.js
  • Updated package.json with bin configuration
  • Added comprehensive CLI tests
  • Updated README with CLI documentation
  • Fixed CI workflow to build before tests

Full Changelog: v0.11.0...v0.12.0

v0.11.0 - Migration Guide & Dependabot

17 Sep 11:01
a279606

Choose a tag to compare

🚀 What's New

Interactive Migration Guide

  • Comprehensive guide for migrating from lodash/underscore
  • Function mapping table showing lodash → nano-string-utils equivalents
  • Step-by-step migration instructions with code examples
  • Automated migration script for large codebases
  • Bundle size comparison demonstrating 96% reduction (73KB → 6.5KB)
  • Search and filtering capabilities for function mappings

🔗 View the Migration Guide

Dependabot Configuration

  • Automated dependency management
  • Weekly updates for npm packages and GitHub Actions
  • Grouped minor/patch updates to reduce PR noise

📦 Installation

npm install [email protected]

📝 Full Changelog

See CHANGELOG.md for complete details.

v0.10.0 - API Documentation Generation

16 Sep 18:01
dae1b7c

Choose a tag to compare

🎉 Release v0.10.0 - API Documentation Generation

✨ What's New

  • 📚 API Documentation: Comprehensive TypeDoc-powered API documentation
  • 🌐 Live Docs: Documentation automatically deployed at https://zheruel.github.io/nano-string-utils/
  • 🎮 Interactive Playground: Test functions directly in the browser
  • 🚀 GitHub Pages Integration: Automatic deployment via GitHub Actions

📝 Changes

  • Added TypeDoc configuration for generating API documentation from JSDoc comments
  • Created documentation site structure with Vite for future enhancements
  • Added GitHub Actions workflow (.github/workflows/docs.yml) for automatic deployment
  • New npm scripts: docs, docs:dev, docs:build, docs:preview
  • All existing functions have complete JSDoc with descriptions, parameters, returns, and examples
  • Added README to docs-src directory with documentation maintenance instructions
  • Updated CLAUDE.md with documentation generation guidelines for new functions

📦 Installation

```bash
npm install [email protected]
```

🔗 Links

v0.9.1 - Enhanced TypeScript JSDoc Examples

07 Sep 11:11
2247b40

Choose a tag to compare

Documentation Enhancement Release

📝 What's New

  • Enhanced JSDoc with TypeScript Examples - Added comprehensive TypeScript usage examples to 20+ utility functions
  • All examples now use proper ```ts code blocks for syntax highlighting
  • Showcased advanced TypeScript features:
    • Template literal types in case conversion functions
    • Branded types with isEmail, isUrl, and slugify
    • Function overloads in template, truncate, and excerpt
    • Generic constraints in memoize
    • Interface usage with FuzzyMatchOptions and FuzzyMatchResult
  • Enhanced interface documentation for all option types

📦 Changes

  • No runtime changes - documentation only
  • No breaking changes
  • All examples validated with TypeScript strict mode

📚 Full Changelog

See CHANGELOG.md for complete details.

v0.9.0: Comprehensive Null/Undefined Safety

07 Sep 07:48
09e473e

Choose a tag to compare

🛡️ Null/Undefined Safety for All Functions

This release adds comprehensive null/undefined handling across the entire library, making it safer and more predictable to use.

✨ What's New

Complete Null Safety - All functions now handle null/undefined gracefully:

// No more runtime errors!
slugify(null);        // Returns: null
slugify(undefined);   // Returns: undefined

// Consistent behavior across all utilities
isEmail(null);        // Returns: false
wordCount(null);      // Returns: 0

🚀 Key Improvements

  • 22+ functions updated with defensive null checks
  • Zero runtime errors - No more TypeErrors on null/undefined inputs
  • Consistent behavior patterns:
    • String functions preserve null/undefined
    • Boolean functions return false
    • Array functions return []
    • Number functions return 0
  • Full backward compatibility maintained for valid inputs
  • 36 comprehensive tests for null/undefined handling

📊 Impact

  • No performance degradation - Benchmarks show consistent speed
  • Minimal size impact - Only 0.02 kB bundle increase
  • Better developer experience - No need for defensive checks
  • TypeScript alignment - Works perfectly with strict null checks

📦 Installation

npm install [email protected]

📚 Documentation

The README now includes a dedicated Null/Undefined Safety section with examples and behavior patterns.

Full Changelog: v0.8.0...v0.9.0

v0.8.0: Template Literal Types for Case Conversions

07 Sep 07:11
f27dc31

Choose a tag to compare

🎉 Template Literal Types for Case Conversions

This release adds advanced TypeScript template literal types for all case conversion functions, providing compile-time type transformations with zero runtime cost.

✨ What's New

Template Literal Types - Get precise type inference for literal strings:

const endpoint = kebabCase("getUserProfile");
// Type: "get-user-profile" (not just string!)

const column = snakeCase("firstName");
// Type: "first_name"

🚀 Key Features

  • All 9 case conversions now support template literal types:

    • camelCase("hello-world") → type: "helloWorld"
    • kebabCase("helloWorld") → type: "hello-world"
    • snakeCase("HelloWorld") → type: "hello_world"
    • pascalCase("hello-world") → type: "HelloWorld"
    • constantCase("helloWorld") → type: "HELLO_WORLD"
    • And more: dotCase, pathCase, sentenceCase, titleCase
  • Advanced type-level parsing:

    • Proper word boundary detection
    • Handles camelCase, PascalCase, ALLCAPS
    • Groups consecutive digits correctly
    • Processes special characters
  • Zero runtime cost - All transformations happen at compile time

  • Full backward compatibility - Runtime strings still return regular string type

  • Enhanced IDE support - Autocomplete shows exact transformed strings

  • No bundle size impact - Remains at 6.01 kB

📦 Installation

npm install [email protected]

📚 Documentation

See the README for detailed examples and usage patterns.

Full Changelog: v0.7.0...v0.8.0