string-ninja
v1.2.0
Published
String manipulation engine that reads like English. Built by Shadow Monarch.
Maintainers
Readme
🥷 stringNinja
String manipulation engine that reads like English. Built by the Shadow Monarch.
Installation
npm install string-ninjaUsage
import SN from "string-ninja";
let email = "[email protected]";
// Check if token exists
SN.check(email, "@"); // true
SN.check(email, "#"); // false
// Split strings
SN.before(email, "@"); // "aafr0408"
SN.after(email, "@"); // "gmail.com"
// Transform case
SN.tcapital(email); // "[email protected]" (Total Capital)
SN.tsmall(email); // "[email protected]" (Total Small)
SN.fcapital(email); // "[email protected]" (First Capital)
SN.fsmall("HELLO"); // "hELLO" (First Small)API
String Checking
check(str, token)→ boolean
Returns true if token exists in str
String Splitting
before(str, token)→ string
Returns everything before token (or original if token missing)after(str, token)→ string
Returns everything after token (or empty if token missing)
Casing
tcapital(str)→ string
Makes all letters uppercasetsmall(str)→ string
Makes all letters lowercasefcapital(str)→ string
Makes ONLY the first letter uppercasefsmall(str)→ string
Makes ONLY the first letter lowercase
Philosophy
Built following Tool Fluency Architecture:
- Reads like spoken English
- Minimizes syntax friction
- No unnecessary abstraction
- Safe defaults (no errors on missing tokens)
- Symbols and numbers remain untouched
License
MIT
Built by DragoHan (Shadow Monarch) as the first JS organ in the grimoire.
