propercase

1.0.2 • Public • Published

This simple module can be used to proper case (sometimes called title case) a string.

It works by lower-casing the string and then capitalizing the first character after certain special characters.

Right now these special characters are defined by: var characters = [' ', '-', ''', '.'];

Installation

npm install propercase --save

Usage

var pcase = require('propercase');
 
console.log(pcase("whaaat? my first public m'odule"));

Examples:

"jim test" becomes "Jim Test"

"JIM TEST" becomes "Jim Test"

"conan o'brien" becomes "Conan O'Brien"

"CONAN O'BRIEN" becomes "Conan O'Brien"

"This-Is A Mix'Of'Tests For Mr.Smith And Mr.Jones" becomes "This-Is A Mix'Of'Tests For Mr.Smith And Mr.Jones"

Regards,

Jim

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i propercase

    Weekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • jimhlad