cAPIta is a REST API for text capitalization and transformation. Powered by capstring, it provides 29 different capitalization styles, spell checking, and multiple output formats.
GET /:style/:string # With content negotiation
GET /:style/:string.:ext # With explicit format
Styles (29 total):
- Case:
upper,lower,title,sentence,proper,swap - Code:
camel,pascal,snake,kebab,slug,constant,python,dot,path,train - Fun:
leet,reverse,sponge,mock,alternate,crazy,random - New:
hashtag,acronym,rot13,flip - Utility:
same,none
Extensions: json, jsonp, html, txt, xml, yaml, yml, csv
GET /spell/:string
GET /spell/:string.:ext
GET /badge/:style/:string # Returns SVG
GET /styles # Returns all available styles
# Title case as JSON
curl http://localhost:4321/title/hello%20world.json
# Snake case as text
curl http://localhost:4321/snake/hello%20world.txt
# Spell check
curl http://localhost:4321/spell/helo%20wrld.json
# Get all styles
curl http://localhost:4321/stylesimport { createApp } from 'capita';
const app = createApp();
app.listen(3000);- XSS protection: HTML output automatically escapes special characters
- Spell checking uses nspell (Hunspell-compatible), no API key needed
- Default port is 4321, configurable via
PORTenv var - ESM-only package
- All 29 styles come from the capstring library
npm test # Run tests
npm run lint # Run ESLint
npm run test:coverage # Run with coverage
npm start # Start serverindex.js- Express server with all routescreateApp()- Factory function for testability- Uses
capstringpackage for all transformations - Uses
nspell+dictionary-enfor spell checking
- capstring - Core library (https://github.com/brianfunk/capstring)