๐งถ Ultra-minimal utilities for manipulating strings
MIT License
Add the dependency from NPM:
npm install PROJECT-NAME
Import the utility you require and use it:
import { capitalize } from "PROJECT-NAME";
const title = capitalize("hello, world!");
console.log(title); // Hello, world!
The following utilities are available:
Utility | Source |
---|---|
slugify("Hello world") โ hello-world
|
utils/slugify.ts |
trim("-hello-", "-") โ hello
|
utils/trim.ts |
capitalize("hello") โ Hello
|
utils/case.ts |
camelCase("hello world") โ helloWorld
|
utils/case.ts |
kebabCase("hello world") โ hello-world
|
utils/case.ts |
snakeCase("hello world") โ hello_world
|
utils/case.ts |
Install dependencies:
yarn
Compile Typescript to ES6 before publishing to NPM:
yarn build