Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
google-drive-client-api
Advanced tools
is a very small library to upload / download / delete or modify files on goole drive.
is a very small library to upload / download / delete or modify files on goole drive.
IMPORTATNT: Currently only works for application-appdata folder, because it was such a mess to get here that I didn't wanted to continue. But feel free to PR, should be an easy fix
npm install google-drive-client-api
import drive from 'google-drive-client-api'
function load() {
// CLIENT_ID is an id you will need to get through the google developer console
// DISCOVERY_DOCS is an array [], can be empty in most cases
// SCOPES list of scopes seperated by spaces, propably one of those: https://www.googleapis.com/auth/drive.appdata or https://www.googleapis.com/auth/drive.appdata or https://www.googleapis.com/auth/drive.file
drive.load("CLIENT_ID", DISCOVERY_DOCS, "SCOPES").then(() => {
console.log("google client loaded");
});
}
function isLoggedIn() {
if(drive.isLoggedIn()) {
console.log("user is logged in");
} else {
console.log("user is NOT logged in");
}
}
function login() {
drive.login().then(() => {
console.log("login successfull");
})
}
function create() {
drive.create("test-file.json").then((data) => {
// file created
// the id of the file is in fileId
let fileId = data.result.id;
// push some content into the file
drive.update(fileId, "Test-Content")
});
}
function list() {
drive.list().then((data) => {
// all files where you have access to
let files = data.result.files;
// download the content of each file
files.forEach(file => {
drive.download(file.id).then((data) => {
file.content = data.body;
})
});
});
}
function deleteFile(id) {
drive.delete(id).then(() => {
// deletet file with given id
});
}
cd example
npm install
npm run dev
FAQs
is a very small library to upload / download / delete or modify files on goole drive.
We found that google-drive-client-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.