Skip to content

Capitalizes a title according to the Chicago Manual of Style.

License

Notifications You must be signed in to change notification settings

timdp/chicago-capitalize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chicago-capitalize

npm Dependencies Build Status JavaScript Standard Style

Capitalizes a title according to the Chicago Manual of Style.

Usage

First, install chicago-capitalize as a dependency:

npm install --save chicago-capitalize

Then, use it in your scripts, like so:

var capitalize = require('chicago-capitalize')

var input = 'The quick brown fox jumps over the lazy dog.'
var output = capitalize(input)

// Prints 'The Quick Brown Fox Jumps Over the Lazy Dog.'
console.log(output)

You can also pass an options object. For now, the only option is whitelist: an array of words not to capitalize. Note that it is case-sensitive.

var input = 'Sent from my iPhone.'
var options = { whitelist: ['iPhone'] }
var output = capitalize(input, options)

// Prints 'Sent from My iPhone.'
console.log(output)

Author

Tim De Pauw

License

MIT

About

Capitalizes a title according to the Chicago Manual of Style.

Resources

License

Stars

Watchers

Forks

Packages

No packages published