Skip to content

v0.12.0 - CLI Tool

Choose a tag to compare

@Zheruel Zheruel released this 17 Sep 11:25
· 45 commits to main since this release
c0fc858

🎉 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