<commit_before>## Synopsis
Redesign the Node.js code on [document of google developers](https://developers.google.com/gmail/api/quickstart/nodejs) that describe the process for creating OAuth2 client and getting credentials. Wrap it as a tiny module and hope to be a good starting point for anyone gonna handle Google APIs in futher with promise-style.
## Installation
```
npm install google-oauth2-client-promisify
```

## How to
### Note
- Make sure that client secrets (json file) was downloaded and moved into your working directory.
- ```npm install googleapis --save``` that allow you to deal with google api.

### example<commit_msg>writing readme<commit_after>## Synopsis
Redesign the Node.js code in [document on google developers](https://developers.google.com/gmail/api/quickstart/nodejs) that describe the process for creating OAuth2 client and getting credentials. Wrap it as a tiny module and hope to be a good starting point for anyone gonna handle Google APIs in futher with promise-style.
## Installation
```
npm install google-oauth2-client-promisify
```

## Example - calling the Gmail API

### Note:
- Make sure that client secrets (json file) was downloaded and moved into your working directory.
- ```npm install googleapis --save``` that allow you to deal with google api.

```js
var oauth2Client = require('google-oauth2-client-promisify');

/**
*SCOPES: Decide what kind of permission would be authorized. More details in https://developers.google.com/gmail/api/auth/scopes
*CLIENT_SECRET_FILE: Path of your client secret file.
*TOKEN_FILE: Just give a name you like for the json file which store token.  
*/

var SCOPES = ['https://www.googleapis.com/auth/gmail.readonly'];
var CLIENT_SECRET_FILE = 'client_secret_blablabla.json';
var TOKEN_FILE = 'gmail-nodejs-collect-mails.json';

```
{'fraction_non_alphanumeric': 0.09597352454495311, 'fraction_numerical': 0.003309431880860452, 'mean_word_length': 4.758730158730159, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2028184', 'n_tokens_mistral': 524, 'n_tokens_neox': 503, 'n_words': 213}