2.0.1 • Published 1 year ago

partially-hide-email-phone v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

Welcome to partially-hide-email-phone šŸ‘‹

Version Documentation Maintenance

šŸ  Homepage

A simple utility to partially hide email addresses or phone numbers.

Features

  • Partially hides email addresses (e.g., exampleemail@domain.com -> ex**pl**ma**@domain.com)
  • Partially hides phone numbers (e.g., 62811203898 -> 6281****898)
  • Validates input for proper email and phone number formats
  • Lightweight and easy to use

Install

Install the package using npm:

npm install partially-hide-email-phone

Usage

Import the module and use the functions to partially hide email addresses and phone numbers:

const hideEmailPhone = require('partially-hide-email-phone');

const email = 'exampleemail@domain.com';
const phoneNumber = '62811203898';

console.log(hideEmailPhone.hideEmail(email)); // Output: ex**pl**ma**@domain.com
console.log(hideEmailPhone.hidePhone(phoneNumber)); // Output: 6281****898

API

hideEmail(email)

  • email (string): The email address to be partially hidden.
  • Returns the partially hidden email address.

hidePhone(phone)

  • phone (string): The phone number to be partially hidden.
  • Returns the partially hidden phone number.

Run tests

Run the test suite to ensure everything is working correctly:

npm run test

Contributing

Contributions are welcome! Please open an issue or submit a pull request with your improvements.

Author

šŸ‘¤ Ali Jaradat (AmJaradat01@gmail.com)

This project is licensed under the MIT License - see the LICENSE file for details.

This implementation should help you enhance the functionality and maintainability of your "partially-hide-email-phone" repository. Let me know if you need further assistance!