name-initials-generator
v1.0.0
Published
A package to generate initials from a name
Downloads
5
Readme
Name Initials Generator
A simple npm package to generate initials from a name, perfect for use in profile pictures or other areas where you want to represent a name with initials.
Installation
You can install this package using npm:
npm install name-initials-generator
const getInitials = require('name-initials-generator');
const name1 = 'John Doe';
const initials1 = getInitials(name1);
console.log(`The initials for "${name1}" are: ${initials1}`); // Outputs: The initials for "John Doe" are: JD
const name2 = 'Jane A. Smith';
const initials2 = getInitials(name2);
console.log(`The initials for "${name2}" are: ${initials2}`); // Outputs: The initials for "Jane A. Smith" are: JAS