proto-toolkit
v1.0.3
Published
A lightweight JavaScript utility toolkit
Maintainers
Readme
proto-toolkit
Lightweight JavaScript utility library that extends native prototypes with useful helper methods.
Version: 1.0.1
npm: https://www.npmjs.com/package/proto-toolkit
Currently focused on String utilities. More features coming soon.
Installation
Using npm
npm install proto-toolkitUsing CDN
<script src="https://cdn.jsdelivr.net/npm/proto-toolkit/dist/proto-toolkit.umd.js"></script>Usage
ES Module
Import the package once in your project:
import 'proto-toolkit';After importing, you can directly use the added methods on strings.
Browser (CDN)
Include the script tag before your custom script:
<script src="https://cdn.jsdelivr.net/npm/proto-toolkit/dist/proto-toolkit.umd.min.js"></script>
<script>
let name = 'Kousik Chowdhury';
console.log(name.mask());
</script>Available Methods
mask()toAbbreviatedName()toCapitalize()
1. mask()
Masks part of a string. Useful for hiding sensitive text like usernames.
Example
import 'proto-toolkit';
let name = 'Kousik Chowdhury';
console.log(name.mask());Output
Ko************ry2. toAbbreviatedName()
Converts a full name into abbreviated format.
Example
import 'proto-toolkit';
let name = 'Kousik Chowdhury';
console.log(name.toAbbreviatedName());Output
K.Chowdhury;3. toCapitalize()
Capitalize first letter of each word.
Example
import 'proto-toolkit';
let name = 'hello i am kousik';
console.log(name.toCapitalize());Output
Hello I Am Kousik;Links
Twitter / X
https://x.com/csakoushik
Website
https://kousikchowdhury.in
Proto-Toolkit Docs
https://proto-toolkit.kousikchowdhury.in
