I hereby claim:
- I am tolsee on github.
- I am tsapkota (https://keybase.io/tsapkota) on keybase.
- I have a public key ASB-OD-1ebRgiVNGqXXczxaVC2wGEHOxNx_3dgm3danwMQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| const Spinner = require('cli-spinner').Spinner; | |
| // Create a spinner | |
| const spinner = new Spinner('Syncing data.. %s'); | |
| // Set a string, that shows loding and replaced with %s in above declaration | |
| spinner.setSpinnerString('▖▘▝▗'); | |
| // Now you can start spinner when ever you want | |
| // For our case before http request |
| const {google} = require('googleapis'); | |
| const calendar = google.calendar({ | |
| version: 'v3', | |
| auth: oauth2Client | |
| }); | |
| const res = await calendar.events.list({ | |
| calendarId: 'primary', | |
| maxResults: 10 | |
| }); |
| gEvent | |
| .command('list') | |
| .option('-f, --from [date]', 'Get events from the date[chrono based date parsing]') | |
| .option('-t, --to [date]', 'Get events until the date[chrono based date parsing]') | |
| .option('-r, --results <events>', 'Number of events to show') | |
| .description('List google event') | |
| .action(async function(args, callback) { | |
| const spinner = new Spinner('Syncing data.. %s'); | |
| spinner.setSpinnerString('▖▘▝▗'); | |
| spinner.start(); |
| gEvent | |
| .command('create [summary...]') | |
| .option('-s, --start [date]', 'Set start date[chrono based date parsing]') | |
| .option('-e, --end [date]', 'Set end date[chrono based date parsing]') | |
| .option('-l, --location [eventLocation]', 'Set location of the event') | |
| .option('--notify', 'Notify me about the event') | |
| .validate(function (args) { | |
| if (!args.options.start) { | |
| return 'start date is missing'; | |
| } else if (!args.options.end) { |
| gEvent | |
| .command('list') | |
| .option('-f, --from [date]', 'Get events from the date[chrono based date parsing]') | |
| .option('-t, --to [date]', 'Get events until the date [chrono based date parsing]') | |
| .option('-r, --results <events>', 'Number of events to show') | |
| .description('List google event') | |
| .action(async function(args, callback) { | |
| const calender = google.calendar({ | |
| version: 'v3', | |
| auth: oauth2Client |
| gEvent | |
| .command('list [date...]') | |
| .description('List google event') | |
| .action(async function(args, callback) { | |
| const calendar = google.calendar({ | |
| version: 'v3', | |
| auth: oauth2Client | |
| }); | |
| const res = await calendar.events.list({ | |
| calendarId: 'primary', |
| const vorpal = require('vorpal')(); | |
| vorpal | |
| .command('say [words...]') | |
| .description('Echo what you type') | |
| .action(function (args, callback) { | |
| this.log(args.words.join(' ')); | |
| callback(); | |
| }); | |
| vorpal | |
| .delimiter('echo $') |
| const gEvent = require('vorpal')(); | |
| const {google} = require('googleapis'); | |
| const opn = require('opn'); | |
| const utils = require('./utils'); | |
| const CLIENT_ID = 'GOOGLE_CLIENT_ID'; | |
| const CLIENT_SECRET = 'GOOGLE_CLIENT_SECRET'; | |
| const REDIRECT_URL = 'urn:ietf:wg:oauth:2.0:oob'; |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const readConfig = () => { | |
| const rawConfig = fs.readFileSync(path.join(__dirname, 'config.json'), 'utf8'); | |
| return JSON.parse(rawConfig); | |
| }; | |
| module.exports.readConfig = readConfig; |