conway-toolbox
v1.2.0
Published
Developer utility toolkit — hash, UUID, slugify, base64, JWT, color, password, URL shortener, QR codes, and more. CLI, library, and free hosted REST API.
Downloads
42
Maintainers
Readme
conway-toolbox
A lightweight developer utility toolkit — pure JavaScript, zero runtime dependencies. Includes full TypeScript type definitions.
Works as both a CLI tool (via npx), a Node.js library, and a hosted REST API.
🌐 Hosted REST API
Don't want to install anything? Use the free hosted API — no setup required.
Base URL: https://conway-toolbox-production.up.railway.app
# Generate a UUID
curl https://conway-toolbox-production.up.railway.app/uuid
# Hash text
curl -X POST https://conway-toolbox-production.up.railway.app/hash \
-H "Content-Type: application/json" \
-d '{"text":"hello world","algo":"sha256"}'
# Shorten a URL
curl -X POST https://conway-toolbox-production.up.railway.app/shorten \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'
# Generate a QR code (returns PNG)
curl -X POST https://conway-toolbox-production.up.railway.app/qr \
-H "Content-Type: application/json" \
-d '{"text":"https://example.com","format":"dataurl"}'Browse all 38+ endpoints: https://conway-toolbox-production.up.railway.app/ui
Rate limits & API keys
- Free tier: 120 requests/minute — no signup required
- Unlimited tier: Send 1 USDC on Base L2 → get an API key with no rate limits
# Use your API key
curl -H "X-API-Key: your-key-here" https://conway-toolbox-production.up.railway.app/uuidTo get an API key: https://conway-toolbox-production.up.railway.app/pay
Install
npm install conway-toolbox
# or use without installing:
npx conway-toolbox <command>CLI Usage
# UUIDs
npx conway-toolbox uuid # one UUID
npx conway-toolbox uuid 5 # five UUIDs
# Hashing
npx conway-toolbox hash "hello world" # sha256
npx conway-toolbox hash "hello world" sha512 # other algorithms: md5, sha1, sha256, sha512
# Base64
npx conway-toolbox b64e "hello world" # encode
npx conway-toolbox b64d "aGVsbG8gd29ybGQ=" # decode
# Slugify
npx conway-toolbox slug "Hello, Café World!" # hello-cafe-world
# Password generator
npx conway-toolbox pw # 16-char password
npx conway-toolbox pw 24 # 24-char password
npx conway-toolbox pw 20 --symbols # include symbols
# Color parser
npx conway-toolbox color "#3498db" # RGB, HSL, luminance, isDark
# Text statistics
npx conway-toolbox stats "The quick brown fox jumped over the lazy dog"
# JWT decode (no signature verification — inspect payload only)
npx conway-toolbox jwt eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjMifQ.sig
# URL parser
npx conway-toolbox url "https://example.com/path?foo=bar&baz=qux"
# Number base converter
npx conway-toolbox base ff 16 10 # hex → decimal: 255
npx conway-toolbox base 255 10 2 # decimal → binary
npx conway-toolbox base 1010 2 10 # binary → decimal
# HTML stripper
npx conway-toolbox strip "<p>Hello <b>world</b></p>"Library Usage
const {
uuid, hash, base64Encode, base64Decode,
slugify, generatePassword, parseColor,
textStats, jwtDecode, parseURL, convertBase, stripHTML
} = require('conway-toolbox');
// UUIDs
uuid() // '3f2504e0-4f89-11d3-9a0c-0305e82c3301'
uuid(3) // ['...', '...', '...']
// Hashing
hash('hello world')
// { algo: 'sha256', hash: 'b94d27b9...', input: 'hello world', length: 64 }
hash('hello', 'md5')
// { algo: 'md5', hash: '5d41402abc...', ... }
// Base64
base64Encode('hello world') // 'aGVsbG8gd29ybGQ='
base64Decode('aGVsbG8gd29ybGQ=') // 'hello world'
// Slugify
slugify('Hello, Café World!') // 'hello-cafe-world'
slugify('foo bar', { separator: '_' }) // 'foo_bar'
// Password generator
generatePassword({ length: 20, symbols: true })
// { password: 'gu(G[EqGc35$lCL*H@C<', entropy: 129.2, length: 20 }
// Color parsing
parseColor('#3498db')
// { hex: '#3498db', rgb: { r:52, g:152, b:219 }, hsl: { h:204, s:70, l:53 }, luminance: 0.283, isDark: false }
// Text statistics
textStats('The quick brown fox jumped over the lazy dog')
// { chars: 44, charsNoSpaces: 35, words: 9, sentences: 0, paragraphs: 1, readingTimeMinutes: 1 }
// JWT decode (no signature verification)
jwtDecode('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.sig')
// { header: { alg: 'HS256', typ: 'JWT' }, payload: { sub: '1234567890' }, signature: '...' }
// URL parsing
parseURL('https://example.com/path?foo=bar')
// { href, protocol, host, hostname, port, pathname, search, hash, origin, params: { foo: 'bar' } }
// Number base conversion
convertBase('ff', 16, 10) // { result: '255', decimal: 255, hex: 'ff', binary: '11111111', octal: '377' }
convertBase('1010', 2, 10) // { result: '10', ... }
// HTML strip
stripHTML('<p>Hello <b>world</b>! <script>alert(1)</script></p>')
// 'Hello world!'API Reference
| Function | Description |
|---|---|
| uuid(n?) | Generate 1 or n UUID v4 strings |
| hash(text, algo?) | Hash text (md5/sha1/sha256/sha512) |
| base64Encode(text) | Base64 encode a string |
| base64Decode(encoded) | Decode a base64 string |
| slugify(text, opts?) | Convert text to URL slug (accent-aware) |
| generatePassword(opts?) | Generate cryptographically secure password |
| parseColor(hex) | Parse hex color → RGB, HSL, luminance |
| textStats(text) | Word/char/sentence/reading time stats |
| jwtDecode(token) | Decode JWT header+payload (no verification) |
| parseURL(url) | Parse URL into components + query params |
| convertBase(value, from, to) | Convert number between bases 2–36 |
| stripHTML(html) | Strip HTML tags, decode entities |
Features
- ✅ Zero runtime dependencies — pure Node.js built-ins only
- ✅ Works as CLI — use with
npx conway-toolbox - ✅ Works as library —
require('conway-toolbox') - ✅ TypeScript-friendly — ships
index.d.tswith full type declarations - ✅ Node.js 18+ — uses modern built-ins
License
MIT
