How to use the google-cloud.bigquery function in google-cloud

To help you get started, we’ve selected a few google-cloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ebidel / lighthouse-httparchive / lighthouse-big-query.js View on Github external
*     4. Verify that latestFetchDate is now the latest.
  *     5. Verify that you see "fetching latest table names" and additional
  *        message for fetching data.
  */

// Author: Eric Bidelman 

'use strict';

const path = require('path');
const fs = require('fs');
const gcloud = require('google-cloud');

const PROJECT_ID = 'lighthouse-viewer';
const CACHE_FILE = '.biqquery_cache.json';
const BigQuery = gcloud.bigquery({projectId: PROJECT_ID});


/**
 * Returns the original object with sorted keys.
 * @param {!Object} obj
 * @return {!Object}
 */
function orderKeys(obj) {
  const ordered = {};
  Object.keys(obj).sort().forEach(key => ordered[key] = obj[key]);
  return ordered;
}

class CacheFile {
  constructor(cacheFilename=CACHE_FILE) {
    this.file = path.join(__dirname, cacheFilename);

google-cloud

Deprecated Cloud APIs Client Library for Node.js

Apache-2.0
Latest version published 7 years ago

Package Health Score

62 / 100
Full package analysis