proper-name-fixifier
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

proper-name-fixifier

NPM Version NPM Downloads

A JavaScript/TypeScript-friendly library for correcting the capitalization of people's names, specifically when they are entirely upper or lower case. The library avoids making unnecessary changes, respecting the wide variety of valid name formats.

I highly encourage everyone to look into the test file for a more exhaustive list of test cases. The test also pulls in names from the 116th US Congress (there's over 500 names in there with various languages, accent marks, titles, and even nicknames).

Influenced by Perl's Lingua-EN-NameCase module and Emgee's namecase

Installation

npm install proper-name-fixifier

Usage

import * as fixifier from 'proper-name-fixifier';

console.log(fixifier.fixCase('johnny mnemonic'));   // Johnny Mnemonic
console.log(fixifier.fixCase('john doe'));          // John Doe
console.log(fixifier.fixCase('JANE DOE'));          // Jane Doe
console.log(fixifier.fixCase('McDONALD'));          // McDonald
console.log(fixifier.fixCase('o\'reilly'));         // O'Reilly

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i proper-name-fixifier

    Weekly Downloads

    88

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    27.4 kB

    Total Files

    11

    Last publish

    Collaborators

    • jmisavage