UNPKG

gmail-api-sync

Version:

Sync, query and parse Gmail e-mails with Google API. Provides full and partial e-mail synchronization, as well as parsing the returned message objects into text and html. Takes care of Google Oauth 2 authentication with convenience methods.

14 lines (12 loc) 350 B
var gmailApiSync = require('../index.js'); var args = process.argv.slice(2); var serverAuthCode = args[0]; gmailApiSync.setClientSecretsFile('./client_secret.json'); gmailApiSync.getNewAccesToken(serverAuthCode,function(err,token){ if(err) { return console.error(err); } else { console.log('token: ' + JSON.stringify(token)); } });