Socket
Socket
Sign inDemoInstall

name-initials

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

name-initials

A JavaScript utility library to extract initials from names.


Version published
Weekly downloads
13K
increased by1.44%
Maintainers
1
Weekly downloads
 
Created
Source

name-initials

A JavaScript utility library to extract initials from names.

Usage

Install the module:

npm install name-initials --save

ES6

import nameInitials from 'name-initials';

const initials = nameInitials('John Smith');

console.log(initials);
// Output: JS

Pre-ES6

var nameInitials = require('name-initials');

var initials = nameInitials('John Smith');

console.log(initials);
// Output: JS

Input => Output

  • E. => E
  • Eric => E
  • E. Vera => EV
  • Eric V. => EV
  • Eric A. E. => EA
  • Eric A. E. Vera => EV
  • Eric A. Vera => EV
  • Eric A. Vera Perez => EV
  • Eric Vera-Perez => EV
  • Eric A. Vera-Perez => EV
  • Eric Vera Perez => EV
  • Eric A. de Vera Perez => ED
  • Eric A. de Vera-Perez => ED
  • Eric A. Perez-de Vera => EP
  • Eric A. Perez de Vera => EP
  • Eric (Instructor Somewhere) => E
  • Éric Vera => ÉV
  • Vera-Perez => VP
  • Eric "No Nickname" Vera => E

License

MIT

Keywords

FAQs

Package last updated on 28 Dec 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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc