google-authorize
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "google-authorize", | ||
"version": "1.0.0", | ||
"description": "Get an OAuth2 client with authorized token to be used with googleapis.", | ||
"version": "1.0.1", | ||
"description": "Get an OAuth2 client with authorized token to be used with Google APIs.", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
#Google Authorize | ||
Get an OAuth2 client with authorized token to be used with googleapis. | ||
Get an OAuth2 client with an authorized token to be used with Google APIs. | ||
All I want for christmas is to be able to easily start working with the googleapis. There is a nice [Node quickstart](https://developers.google.com/sheets/api/quickstart/nodejs) that Google provided that allows this. This module is a wrapper of that code but instead of executing a callback function with the resultant OAuth2 client, it returns a Promise that is _thenable_ which resolves the OAuth2 client. | ||
All I want for Christmas is to be able to easily start working with the Google APIs. There is a nice [Node quickstart](https://developers.google.com/sheets/api/quickstart/nodejs) that Google provides for this. This module is a wrapper of that code but instead of executing a callback function that passes a resultant OAuth2 client, it returns a Promise that is _thenable_ which resolves the OAuth2 client. | ||
@@ -14,3 +14,2 @@ Here's how to use it: | ||
npm i google-authorize --save | ||
npm i googleapis --save | ||
``` | ||
@@ -20,4 +19,2 @@ | ||
const GoogleAuthorize = require('google-authorize'); | ||
// Used to make requests to the googleapis | ||
const google = require('googleapis'); | ||
@@ -28,11 +25,7 @@ // Use an array of scopes that correlate to to googleapi scopes | ||
// Use the example function, listMajors, from Google | ||
// Authorize and then make a request to the sheets API | ||
googleAuth.authorize().then(listMajors); | ||
/** | ||
* Print the names and majors of students in a sample spreadsheet: | ||
* https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit | ||
*/ | ||
function listMajors(auth) { | ||
var sheets = google.sheets('v4'); | ||
var sheets = require('googleapis').sheets('v4'); | ||
sheets.spreadsheets.values.get({ | ||
@@ -39,0 +32,0 @@ auth: auth, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7637
52