Package Exports
- name-initials
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (name-initials) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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