prompt-email
v0.0.2
Published
Command line interface prompt email with autocompletion, validation and email lookup
Downloads
13
Maintainers
Readme
prompt-email
Command line interface prompt email with autocompletion, validation and email lookup
Install
$ npm install prompt-email
Usage
import promptEmail from 'prompt-email'
promptEmail()
.then(email => console.log(`\n> Hello ${email}`))
.catch(err => console.log('\n> Abort'))
// => > Hello [email protected]
It uses email-prompt under the hood with a couple changes.
Demo
How it works
It tries to find the username of the current user and get the email of the npm user using the username. It's not a solution 100% bulletproof, that's why if it can't find the email it will prompt the user for their email. I also added the verify
param so you can skip that verification and direct prompt the user.
API
promptEmail({ verify })
verify
Type: boolean
Default: true
If set to false
, it will skip the email lookup and will prompt for email.
License
MIT © Bu Kinoshita