name-suffixes

0.0.1 • Public • Published

name-suffixes NPM version Build Status Dependency Status Coverage percentage

Identify name suffixes

For the most part, this is just the code version of the Wikipedia page on name suffixes. Each suffix has three parts: a list of variants, which is a list of all of the versions of the same suffix that differ in more than punctation, whitespace, or capitalization; a canonical version, which is a standard way of identifying a single suffix, and a type, which is one of: generational, academic, professional or religious.

Installation

$ npm install --save name-suffixes

Usage

var nameSuffixes = require('name-suffixes').suffixes;
 
nameSuffixes.forEach(suffix => {
  console.log(suffix.variants); // ['Jr', 'II', 'Junior']
  console.log(suffix.canonical); // 'Jr'
  console.log(suffix.type); // generational
});
 
var isSuffix = require('nameSuffixes').isSuffix;
 
console.log(isSuffix('Sr')); // true
console.log(isSuffix('Wade')); // false
 
var canonize = require('nameSuffixes').canonize;
 
console.log(canonize('II')); // { variants: ['Jr', 'II', 'Junior'], canonical: 'jr', type: 'generational' }
console.log(canonize('Wade')); // undefined

License

MIT © Doug Wade

/name-suffixes/

    Package Sidebar

    Install

    npm i name-suffixes

    Weekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • douglas.wade