Socket
Socket
Sign inDemoInstall

saymyname

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    saymyname

Lexer for parsing human people name


Version published
Weekly downloads
3
decreased by-62.5%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 14 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc