node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



Node.js library to read a Google Drive Doc and convert to JSON (via ArchieML)

This is a work-in-progress.


npm install googledoc-to-json --save



$ npm install -g googledoc-to-json
$ googledoc-to-json <doc-id> -c config.json -o output.json


const GoogleDocToJSON = require('googledoc-to-json');
const config = require('./config.json'); // see 'Getting Credentials' below 
const gDocToJSON = new GoogleDocToJSON(config);
const options = {
    fileId: '1gTERIVPV_0yoMXc6mlBtBpNvaoH5pIU2IC-75V_Qcas',
    oAuthTokens: config.oAuthTokens
gDocToJSON.getArchieML(options, function (err, aml) {
    console.log('## ArchieML output', err, aml);

Getting credentials

  1. Got to
  2. Create an account
  3. In the right sidebar click Credentials
  4. Then click Create credentials, select oAuth client ID, select Web application
  5. Name your Web Application
  6. Enter as an authorized redirect URLs
  7. Have your Client ID and Client secret ready
  8. Go to
  9. Under Step 1 authorize all Dirve API v3
  10. Click the Gear button in upper right of the page and check Use your own OAuth credentials
  11. Enter your Client ID and Client secret
  12. Click Authorize APIs
  13. Then request auth tokens, grab generated the refresh token.
  14. Create a config.json in your project with your info:
  "google": {
    "client_id": yourID,
    "client_secret": yourSecret,
    "oAuthTokens":{"refresh_token": yourRefreshToken},


  • Add Mocha tests