Skip to content

darlanmendonca/abbreviate-names

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abbreviate the lastnames, except the last:

'George Raymond Richard Martin' => 'George R. R. Martin'

Install

npm i abbreviate-lastnames

Usage

Just import the module, and use their like a function

import abbreviate from 'abbreviate-lastnames'

abbreviate('George Raymond Richard Martin')// => 'George R. R. Martin'

If you want set the numbers of lastnames to keep, pass a number in second argument

// will keep the two lastnames
abbreviate('George Raymond Richard Martin', 2) ==> 'George R. Richard Martin'

Prepositions

In portuguese, or spañol languages, the names commonly have prepositions, like de, dos, or el. This module know that, and by default, keep these, without abbreviate it. E.g.

abbreviate('Darlan Mendonça de Oliveira Almeida') ==> 'Darlan M. de O. Almeida'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published