1.0.3 • Published 5 years ago
captalize v1.0.3
captalize
A Javascript library to captalize string.
1 KB, one file.
Install
$ npm install --save captalize
Usage
const captalize = require('captalize');
const textCaptalized = captalize('my text to cap')
// 'My text to cap'
API
captalize(text, options)
text
Type: string
Text to captalize.
options
Type: Object
type
Type: string
Default: first
Words to captalize: first
or *
separator
Type: string
Separator of the sentence for words to be captalize. Ex: ' '
or '-'
Examples
captalize('my text to cap', { type: 'first' })
// 'My text to cap'
captalize('my text to cap', { type: '*', separator: ' ' })
// 'My Text To Cap'
License
MIT ©