Closed YasharF closed 5 years ago
Hello,
Do we free to use npm libraries like https://github.com/niftylettuce/node-google-drive ?
Typically it is OK to use npm packages given that they are actively maintained, used, and are free of security vulnerabilities.
The other question to ask about integrating this particular package would be, Hackathon Starter already does OAuth authentication with Google. Will that package be redundant in that sense, or is it only adding capabilities that are not there already.
Basically it works as expected, with some lines of code like this
exports.getGoogleDrive = (req, res) => {
const gdrv = require('google-drive');
const token = req.user.tokens.find(token => token.kind === 'google');
gdrv(token.accessToken).files().list(function(err, fileList) {
let files = JSON.parse(fileList.body);
res.render('api/google-drive', {
title: 'Google Drive API',
files: files,
});
})
};
I can get my list of my files... I'll check it and improve if I can.
I just did a manual check, and it looks like the npm dev dependency everyauth is problematic since it has been abandoned and is unmaintained. Prior to integration of google-drive npm module, if that is the only choice, the dependency on everyauth needs to be removed. Created the issue: https://github.com/niftylettuce/node-google-drive/issues/30
$ npm install
npm WARN google-drive@0.0.8 No license field.
audited 655 packages in 2.243s
found 38 vulnerabilities (21 low, 3 moderate, 14 high)
run `npm audit fix` to fix them, or `npm audit` for details
https://github.com/google/google-api-nodejs-client is the officially supported and activly maintained google API package with 790K downloads per month. We might be better off using the officially maintained package instead.
Yeah, seems better idea. I'll try to make same thing with that one too.
I converted them to official client. I'll polish them a bit then create PR (I hope)
@tanaydin were you able to make any progress on your PR?
Hello I've some progress with https://github.com/sahat/hackathon-starter/pull/972 I'll fix PR with comments and update it.
Google Drive API example done: https://github.com/sahat/hackathon-starter/commit/e2871fde95b0871319353448e2fe84b923116ff7
Thank you @tanaydin 🙂
Google Sheets Example: https://github.com/sahat/hackathon-starter/commit/36126f671a0c84a8012414ad855ecf206ecc6991
Thank you @clarkngo 🙂
Need an API integration example for Google Drive & Google Doc. These could be split into two seperate API examples.
In case of Google Drive, it is desired to be able to read or write a file to the drive. In case of a Google Docs, it would be desired to be able to access content such as a spreadsheet data in a google spreadsheet.