Capitalize every word in a string:
unicorn cake
→Unicorn Cake
$ npm install titleize
const titleize = require('titleize');
titleize('foo bar');
//=> 'Foo Bar'
titleize('foo-bar');
//=> 'Foo-Bar'
- camelcase - Convert a dash/dot/underscore/space separated string to camelcase
MIT © Sindre Sorhus