https://github.com/bukinoshita/prompt-email
Command line interface prompt email with autocompletion, validation and email lookup
https://github.com/bukinoshita/prompt-email
cli command-line email javascript nodejs
Last synced: 6 months ago
JSON representation
Command line interface prompt email with autocompletion, validation and email lookup
- Host: GitHub
- URL: https://github.com/bukinoshita/prompt-email
- Owner: bukinoshita
- License: mit
- Created: 2017-06-10T02:43:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-04T04:39:26.000Z (over 6 years ago)
- Last Synced: 2025-02-18T17:09:17.573Z (8 months ago)
- Topics: cli, command-line, email, javascript, nodejs
- Language: JavaScript
- Homepage:
- Size: 475 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prompt-email [](https://travis-ci.org/bukinoshita/prompt-email)
> Command line interface prompt email with autocompletion, validation and email lookup## Install
```bash
$ npm install prompt-email
```## Usage
```javascript
import promptEmail from 'prompt-email'promptEmail()
.then(email => console.log(`\n> Hello ${email}`))
.catch(err => console.log('\n> Abort'))// => > Hello bukinoshita@gmail.com
```_It uses [email-prompt](https://github.com/zeit/email-prompt) under the hood with a [couple changes](https://github.com/bukinoshita/prompt-email/blob/master/lib/email-prompt.js)._
## Demo

## How it works
It tries to [find the username of the current user](https://github.com/bukinoshita/prompt-email/blob/master/lib/get-email.js) and [get the email of the npm user using the username](https://github.com/bukinoshita/prompt-email/blob/master/lib/get-email.js). 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: trueIf set to `false`, it will skip the email lookup and will prompt for email.
## License
MIT © [Bu Kinoshita](https://bukinoshita.io)