0.1.2 • Published 4 years ago

saymyname v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Build Status

SayMyName lets you split human name (into firstname and name) and aims to return the correct letter case.

Installation

With npm

npm install saymyname

In a browser

<script type="text/javascript" src="saymyname.js"></script>

Usage

// full name constructor
var myName = new SayMyName("jean de la fontaine");

console.log(myName.humanize()); // return "Jean de La Fontaine"
console.log(myName.firstname);  // return "Jean"
console.log(myName.name);      // return "de La Fontaine"

// firstname + name constructor
var myName = new SayMyName("JEAN BAPTISE","POQUELIN");

console.log(myName.humanize()); // return "Jean-Baptiste Poquelin"
console.log(myName.firstname);  // return "Jean-Baptise"
console.log(myName.name);      // return "Poquelin"

Limitations

I tried to catch as many case as possible (specially with nobiliary particle) but human naming is not (read: not at all) a science. Many thanks to you, Wikipedia.

Contributions

Feel free to contribute

0.1.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.0.9

8 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.1

9 years ago