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 🙏

© 2026 – Pkg Stats / Ryan Hefner

two-step-auth

v1.1.2

Published

Helps in veryfying the Email id of a user via (OTP)

Readme

two-step-auth

This is a npm package that helps in verifying an Email address by sending OTP

Installation

npm i --save two-step-auth

What It Does

For people developing login sections they must know if the email Id the end user provides is valid, thus this package takes in the Email ID they provide and returns you a data OTP to verify them, and sends the client one via Email, Thus making sure only verified Emails are encouraged.

General Default Usage

Kindly Provide a Company Name so the mail will be treated as important, but you can continue without it also, Usually the server responds within seconds ~ =< 2 seconds, incase the server is inactive it might take upto ~ <= 10 seconds, And you can handle the Time you need the OTP to be valid from your project in your script and do the necessary :)

const {Auth} = require('two-step-auth');

async function login(emailId){
    const res = await Auth(emailId);
    // You can follw the above approach, But we recommend you to follow the one below, as the mails will be treated as important
    const res = await Auth(emailId, "Company Name");
    console.log(res);
    console.log(res.mail);
    console.log(res.OTP);
    console.log(res.success);
}

login("[email protected]")

Custom Mail ID Usage

Kindly enable less secure apps in the link provided below, with your mail ID that you plan to use, and enable it! This will use your email ID and password to send mails to the client. Kind note we never store your passwords, and email Ids, we just transfer messages and logout :)

Steps

  • Pull in the LoginCredentials object from the package, and change the following, And they should be added before calling the Auth function (only for custom mail ID)
    • LoginCredentials.mailID = "Your mail ID"
    • LoginCredentials.password = "Your Password"
    • LoginCredentials.use = true
const {Auth, LoginCredentials} = require('two-step-auth')

async function login(emailId){
    try {
        const res = await Auth(emailId, "Company Name");
        console.log(res);
        console.log(res.mail);
        console.log(res.OTP);
        console.log(res.success);
    } catch (error) {
        console.log(error)
    }
}


LoginCredentials.mailID = "[email protected]" //This should have less secure apps enabled
LoginCredentials.password = "Your password" // you can store them in your env variables and access them, it will work fine
LoginCredentials.use = true

login("[email protected]") //pass in the mail ID you need to verify

you will get a error message, if less secure apps is not enabled

Output Format

The output will be a Javascript JSON object, making it easy to work

{
  status: 200,
  mail: '[email protected]',
  OTP: 118740,
  success: true
}
[email protected]
118740
true

Email Sample

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Privacy Policy

We never share the email ID's we get to any service, nor do we use them for our purposes, we regularly clean up the sent mail section, and we never save any data on our servers, we work on the main motive to be OPEN SOURCE , If so you have any queries kindly mail me at the email ID provided Always happy to answer :)