npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bhimupijs

v2.0.0

Published

Bhimupijs is an npm module that can be used to validate, verify, and generate QR codes for UPI IDs. It is a lightweight and easy-to-use library.

Downloads

2,145

Readme

Bhimupijs

NPM version GIT Stars Download GitHub Sponsors LICENSE Maintenance Issues

Bhimupijs is a lightweight npm module that provides functionalities to validate, verify, and generate QR codes for UPI IDs (Unified Payments Interface). It aims to simplify the process of working with UPI handles, making it easy to perform checks and generate QR codes for payment transactions.

Features

  • Validate the format of UPI IDs (VPAs).
  • Verify the validity of UPI IDs by querying a remote service.
  • Generate QR codes for UPI IDs.

Bhimupijs Command-Line Interface (CLI)

Bhimupijs provides a convenient command-line interface (CLI) that allows you to perform various tasks related to UPI (Unified Payments Interface) handles, such as validation, verification, and QR code generation.

Root Installation

To use the Bhimupijs CLI, you need to install the package globally on your system using the following command:

npm install -g bhimupijs

cli Usage

The Bhimupijs CLI supports several commands and options. Here are the available commands:

Options

  • --help, -h: Display usage information and available options.
  • --qrcode, --qr: Generate and display a QR code.
  • --vp, --vp: Show detailed UPI ID information.
  • --name, -n: Display the extracted handle name from the UPI ID.

To verify a UPI ID by querying a remote service:

bhimupijs <upiId> 

Example:

bhimupijs sumithemmadi@ybl

Validate UPI ID

Use the --vp to validate a UPI ID (VPA) pattern:

bhimupijs <upiId> --vp

Example:

bhimupijs  sumithemmadi@paytm --vp

Generate QR Code

Use the --qr command to generate a QR code for a valid UPI ID:

bhimupijs  <upiId> --qr

Example:

bhimupijs  sumithemmadi@paytm --qr

Usage

Installation

npm install bhimupijs

Here's a quick example of how you can use Bhimupijs to validate and verify UPI IDs:

validate UPI Id

import { validatePattern, ValidateVPA } from 'bhimupijs';

function validateUPI(vpa: string): void {
  const validationResult: ValidateVPA = validatePattern(vpa);

}

validateUPI('sumithemmadi@paytm');

// {
//   query: 'sumithemmadi@paytm',
//   isQueryPatternValid: true,
//   message: 'Valid VPA Pattern!',
//   tpap: 'Paytm',
//   pspBank: 'Paytm Payments Bank (PPBL) ',
//   link: 'https://paytm.com/',
//   userId: 'sumithemmadi',
//   handleName: 'paytm'
// }
  • query: The original VPA pattern.
  • isQueryPatternValid: A boolean indicating whether the VPA pattern is valid.
  • message: A message indicating the validation result ("Valid VPA Pattern!" or "Invalid VPA Pattern!").
  • tpap: The Third-Party App Provider associated with the handle name (if valid and found).
  • pspBank: The Payment Service Provider bank associated with the handle name (if valid and found).
  • link: A link associated with the handle name (if valid and found).
  • userId: The user identifier extracted from the VPA pattern.
  • handleName: The handle name extracted from the VPA pattern.

Verify UPI Id

import { verifyUPI, VerifyVPA } from 'bhimupijs';

async function main() {
    const upiId = 'sumithemmadi@paytm';

    try {
        const response: VerifyVPA = await verifyUPI(upiId);
        console.log(response)
    } catch (error: any) {
        console.error('Error:', error.message);
    }
}

main();

// {
//   result: true,
//   query: 'sumithemmadi@paytm',
//   isQueryPatternValid: true,
//   isVpaVerified: true,
//   vpa: 'sumithemmadi@paytm',
//   payeeAccountName: 'Emmadi Sumith Kumar',
//   tpap: 'Paytm',
//   pspBank: 'Paytm Payments Bank (PPBL) ',
//   link: 'https://paytm.com/',
//   userId: 'sumithemmadi',
//   handleName: 'paytm',
//   message: 'Valid UPI ID'
// }
  • result: A boolean indicating the overall result of the verification process.
  • query: The original VPA pattern that was verified.
  • isQueryPatternValid: A boolean indicating whether the VPA pattern is valid.
  • isVpaVerified: A boolean indicating whether the VPA is verified by the API.
  • vpa: The verified VPA (if verification is successful).
  • payeeAccountName: The payee account name associated with the verified VPA (if verification is successful).
  • tpap: The Third-Party App Provider associated with the handle name from the VPA pattern (if valid and found).
  • pspBank: The Payment Service Provider bank associated with the handle name from the VPA pattern (if valid and found).
  • link: A link associated with the handle name from the VPA pattern (if valid and found).
  • userId: The user identifier extracted from the VPA pattern.
  • handleName: The handle name extracted from the VPA pattern.
  • message: A message providing information about the verification result.

For more detailed examples and API documentation, please refer to the API Documentation.

Contributing

Contributions are welcome! If you have suggestions, bug reports, or want to add new features, feel free to open an issue or submit a pull request on GitHub.

Troubleshooting

If you encounter any issues or have questions, please refer to the GitHub repository for this package or open an issue there.

💝 Sponsor

If you find TruecallerJS helpful or inspiring, consider supporting me through GitHub Sponsors. Your sponsorship helps me dedicate more time and effort to open source development and creating impactful projects.

💖 Sponsors

Sponsors

Acknowledgments

Thank you for choosing TruecallerJS! I hope it helps you retrieve phone number details efficiently.

License

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