File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- /*
1+ /**
22 *
33 * Author: Muhammad Saad
44 * GitHub: msaaddev
55 * Twitter: https://twitter.com/msaaddev
66 */
77
8- const io = require ( "console-read-write" ) ;
9- const { cyan } = require ( "chalk" ) ;
10- const box = require ( "./utils/box" ) ;
11- const axios = require ( "axios" ) ;
8+ const cli = require ( "./utils/cli" ) ;
129
13- module . exports = async ( ) => {
14- console . log ( "------------------------------------------" ) ;
15- // getting data from terminal
16- io . write ( cyan ( "> Enter GitHub username" ) ) ;
17- const URL = await io . read ( ) ;
18- await axios
19- . get ( `https://api.github.com/users/${ URL } /events/public` )
20- . then ( ( res ) => {
21- for ( let i = 0 ; i < res . data . length ; i ++ ) {
22- if ( res . data [ i ] . type === "PushEvent" ) {
23- const name = "✉️ Email" ;
24- box ( name , res . data [ i ] . payload . commits [ 0 ] . author . email ) ;
25- break ;
26- }
27- if ( i === res . data . length - 1 ) {
28- const name = "⚠️ WARNING" ;
29- const msg = "No Email Found!!" ;
30- box ( name , msg ) ;
31- }
32- }
33- } )
34- . catch ( ( err ) => {
35- const name = "⚠️ WARNING" ;
36- const msg = "Cannot Access Email!!" ;
37- box ( name , msg ) ;
38- } ) ;
39- } ;
10+ cli ( ) ;
You can’t perform that action at this time.
0 commit comments