/shortname-js

`shortname-js`is a JavaScript function designed to shorten names (Portuguese - PT 🇵🇹 | BR 🇧🇷 | AO 🇦🇴) in a simple and user-friendly way. The function allows users to quickly enter full names and receive abbreviated versions of those names in return. 😅

Primary LanguageTypeScriptMIT LicenseMIT

shortname-js is a JavaScript function designed to shorten names (Portuguese - PT 🇵🇹 | BR 🇧🇷 | AO 🇦🇴) in a simple and user-friendly way. The function allows users to quickly enter full names and receive abbreviated versions of those names in return. 😅

The MIT License The MIT License

Install

yarn

yarn add @mosmmy/shortname-js

NPM

npm install @mosmmy/shortname-js

Use

const {shortName} = required('@mosmmy/shortname-js')

console.log(shortName('Jorge Pedro André dos Santos'))          //Jorge P. A. dos Santos

console.log(shortName('Pedro de Sousa André'))                  //Pedro S. André

console.log(shortName('Marcos Ângelo Mateus dos Santos'))       //Marcos A. M. dos Santos

To run the test locally:

npm run dev

Licence

This project is governed by the MIT. Just remember to be a nice person and send back any modifications, corrections or improvements. ✌️

Author


@moser-jose