proto-toolkit

Lightweight JavaScript utility library that extends native prototypes.

Installation

Using npm

npm install proto-toolkit

Using CDN

<script src="https://cdn.jsdelivr.net/npm/proto-toolkit/dist/proto-toolkit.umd.js"></script>

Usage

import 'proto-toolkit';

let name = "Kousik Chowdhury";
console.log(name.mask());
console.log(name.toAbbreviatedName());

Methods

mask()

Masks part of a string. Useful for hiding sensitive text.

let name = 'Kousik Chowdhury'
console.log(name.mask())
// Output: Ko************ry

toAbbreviatedName()

Converts full name into abbreviated format.

let name = "Kousik Chowdhury"
console.log(name.toAbbreviatedName())
// Output: K. Chowdhury