![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
node-google-drive-new
Advanced tools
Library to operate with Google Drive API v3 from Node.js, using system user tokens or personal keys
Library to operate with Google Drive API v3 from Node.js, using system user tokens or personal keys
This library is heavily inspired on theozero's' google-spreadsheet. No, I mean, really inspired. As in blatantly copied. The only difference being his library is to operate with google spreadsheets and this one is to interact with google drive.
So, basically, you can operate in two ways. You either use Google Oauth and manually enter your credentials everytime, or use a Service Account and forget about further authentications.
(the following is taken from google-spreadsheet docs)
Let's say you stored your user credentials in a file called my_credentials.json
. And you gave permission to the service account's email address over a folder in your Google Drive whose id is 1bibD4HDZVbqOPq882YSDTmZlI06fZvLU
. So you would do:
const YOUR_ROOT_FOLDER = '1bibD4HDZVbqOPq882YSDTmZlI06fZvLU',
PATH_TO_CREDENTIALS = path.resolve(`${__dirname}/my_credentials.json`);
// Let's wrap everything in an async function to use await sugar
async function ExampleOperations() {
const creds_service_user = require(PATH_TO_CREDENTIALS);
const googleDriveInstance = new NodeGoogleDrive({
ROOT_FOLDER: YOUR_ROOT_FOLDER
});
let gdrive = await googleDriveInstance.useServiceAccountAuth(
creds_service_user
);
// List Folders under the root folder
let folderResponse = await googleDriveInstance.listFolders(
YOUR_ROOT_FOLDER,
null,
false
);
console.log({ folders: folderResponse.folders });
// Create a folder under your root folder
let newFolder = { name: 'folder_example' + Date.now() },
createFolderResponse = await googleDriveInstance.createFolder(
YOUR_ROOT_FOLDER,
newFolder.name
);
newFolder.id = createFolderResponse.id;
debug(`Created folder ${newFolder.name} with id ${newFolder.id}`);
// List files under your root folder.
let listFilesResponse = await googleDriveInstance.listFiles(
YOUR_ROOT_FOLDER,
null,
false
);
for (let file of listFilesResponse.files) {
debug({ file });
}
}
ExampleOperations();
See API for a description of available methods.
FAQs
Library to operate with Google Drive API v3 from Node.js, using system user tokens or personal keys
The npm package node-google-drive-new receives a total of 29 weekly downloads. As such, node-google-drive-new popularity was classified as not popular.
We found that node-google-drive-new 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.