transform-string
v0.0.1
Published
Transform any string using properties CSS like
Downloads
1
Maintainers
Readme
transform-string
Transform any string using properties CSS like
Install
$ npm install transform-string
Usage
const transformString = ('transform-string');
transformString('unicorns');
//=> 'Unicorns'
transformString.capitalize('hello world');
//=> 'Hello World'
or
import transformString, { capitalize } from 'transform-string';
transformString('unicorns');
//=> 'Unicorns'
capitalize('hello world');
//=> 'Hello World'
API
transformString(input, [options])
input
Type: string
The input to be transformed
options
Type: object
type
Type: string
Default: title
String transform type.
Types:
title
capitalize
lowercase
uppercase
title(input)
input
Type: string
Capitalizes first letter of string
capitalize(input)
input
Type: string
Capitalizes first letter of each word in string
lowercase(input)
input
Type: string
Converts all to lowercase
uppercase(input)
input
Type: string
Converts all to uppercase
Related
- capitalize-first-letters Capitalizes first letters of each word in string
License
MIT © Abraham Hernandez