Socket
Socket
Sign inDemoInstall

googleapis

Package Overview
Dependencies
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

googleapis - npm Package Compare versions

Comparing version 0.2.4-alpha to 0.2.5-alpha

.cache/plusv1

37

lib/googleapis.js

@@ -17,7 +17,8 @@ /**

var Client = require('./client.js'),
var async = require('async'),
Cache = require('./cache.js'),
Client = require('./client.js'),
DefaultTransporter = require('./transporters.js'),
qs = require('querystring'),
requests = require('./requests.js'),
DefaultTransporter = require('./transporters.js'),
async = require('async');
requests = require('./requests.js');

@@ -55,2 +56,3 @@ /**

this.toBeDiscovered = [];
this.cache = new Cache();
this.transporter = exports.Transporter || new DefaultTransporter();

@@ -134,12 +136,20 @@ }

var that = this;
// make the request and generate client
var opts = {
uri: this.generateDiscoveryUrl(api), json: true
};
this.transporter.request(opts, function(err, json, res) {
var generateClient = function(err, data) {
var client = null;
if (!err && json) { client = new Client(json); }
if (!err && data) {
that.cache.write(api, data);
client = new Client(data);
}
opt_callback && opt_callback(err, client);
});
};
var data = this.cache.load(api);
if (data) {
generateClient(null, data);
} else {
that.transporter.request({
uri: that.generateDiscoveryUrl(api), json: true
}, generateClient);
}
};

@@ -175,2 +185,7 @@

/**
* Shortcut to GoogleApis.
*/
googleapis.GoogleApis = GoogleApis;
/**
* Shortcut to OAuth2Client.

@@ -177,0 +192,0 @@ */

@@ -75,3 +75,6 @@ /**

}
url += '?' + querystring.stringify(opt_params);
var params = querystring.stringify(opt_params);
if (params) {
url += '?' + params;
}
return url;

@@ -78,0 +81,0 @@ };

{
"name": "googleapis",
"version": "0.2.4-alpha",
"version": "0.2.5-alpha",
"author": "Google Inc.",

@@ -5,0 +5,0 @@ "description": "Google APIs Client Library for Node.js",

@@ -48,6 +48,6 @@ # google-api-nodejs-client [alpha]

Client libraries are generated during runtime by metadata provided by Google
APIs Discovery Service. Metadata provided by Discovery Service is not cached,
but requested each time you load a client. We're making changes to improve the
situation for short-lived node processes. Below, there is an example of loading
a client for [URL Shortener API](https://developers.google.com/url-shortener/).
APIs Discovery Service. Metadata provided by Discovery Service is cached,
and won't be requested each time you load a client. Below, there is an
example of loading a client for
[URL Shortener API](https://developers.google.com/url-shortener/).

@@ -54,0 +54,0 @@ googleapis

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc