Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-authorize

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-authorize - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

package.json
{
"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,

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