text-transform
v0.1.2
Published
A microlibrary to transform strings with CSS-like properties
Downloads
208
Maintainers
Readme
text-transform
Tiny library to transform text with CSS-like properties. Great for transforming text in environments whre the full CSS spec might not be available to you, such as Node.js or React Native.
Get Started
npm i text-transform
import { textTransform } from 'text-transform';
Or if you're not using ES6 imports, you can require like so:
const { textTransform } = require('text-transform');
Usage
// textTransform(text: string, type: string);
let a = textTransform('My String', 'uppercase');
// MY STRING
Available Types
uppercase
- Converts all to uppercaselowercase
- Converts all to lowercasetitle
- Capitalizes first letter of each word in stringcapitalize
- Capitalizes first letter of stringinitial
- Returns original string