Socket
Book a DemoInstallSign in
Socket

abbreviate-name

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abbreviate-name

Abreviate names

0.0.1
latest
npmnpm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

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'

Keywords

string

FAQs

Package last updated on 28 Nov 2016

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.