see example here: https://github.com/nodemailer/nodemailer/blob/master/examples/oauth2.js
1. npm i (to install all the dependencies on package.json)
2. and run npm start on your terminal
see here: https://support.google.com/googleapi/answer/6158862
step:
1. got to your console API google: https://console.developers.google.com/apis/library?project=poppins-142912
2. create a project
3. create crdential
4. choose oAuth clientID
5. click website service radio button
6. and you got client ID and secret
7. and go visit this link: https://developers.google.com/identity/protocols/OAuth2WebServer
redirect_uri & client_id : the same as your credential app redirect_uri & client_id it will response 404 page, but you just need the "code". save the code for the next step
code is code, client_id is still the same, client_secret: you can see it at you credential too, take the access_token from the response.
and now you'll have all the things you need.
then the cool part,
simply follow this 3 steps:
1. npm i -g now
2. go to the file directory
3. now "or" /usr/local/Cellar/node/6.3.1/bin/now
4. wait till it done uploading, and save the url they gave you in the terminal
5. go to postman, and have fun