Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
utils-google-drive
Advanced tools
A simple and flexible package for interacting with Google Drive.
Perform the following actions on files and folders in Google Drive:
utils-google-drive allows files and folders in Google Drive to be specified by either name or id. Information on the parent folder can and many times should also be included. For example, specifying a parent will resolve the ambiguity of trying to access a file or folder by name when there are multiple files/folders in Google Drive with that name.
Objects with the properties fileId
/folderId
, fileName
/folderName
, parentId
, and parentName
are generally used to specify a file or folder and are passed as arguments to utils-google-drive methods. For convenience, a string containing the file/folder id may also be passed instead. Consult the docs for details on the arguments that each method accepts.
const utilsGDrive = require("utils-google-drive");
// get id of folder in Google Drive whose name is "mainFolder"
// and whose parent folder is named "parentFolder"
utilsGDrive.getFileId({
fileName: "mainFolder",
parentName: "parentFolder"
});
// change name of folder from "beforeName" to "afterName"
utilsGDrive.rename({folderName: "beforeName"}, "afterName");
// download file "excelFile.xlsx" in the folder "dataFolder"
// to the local folder "driveDownloads"
utilsGDrive.download({
fileName: "excelFile.xlsx",
parentName: "dataFolder"
}, "path/to/driveDownloads");
// upload file "report.pdf" to the folder in Google Drive
// with the id "folderId"
utilsGDrive.upload({
localPath: "path/to/report.pdf",
parentId: "folderId"
});
// move folder "reports" in Google Drive to root folder
// "root" is special API keyword
utilsGDrive.move({fileName: "reports"}, {newParentId: "root"});
// delete file with id "fileId"
utilsGDrive.del("fileId");
// make a new folder in the folder "parentFolder"
utilsGDrive.makeFolder("newFolder", {parentName: "parentFolder"});
npm install utils-google-drive
You'll need to set up a Google Cloud project to access your user account's Google Drive. Follow step 1 at this link to start a such a project, enable the Google Drive API, and download credentials all in one step. Be sure you're logged in to the correct Google account when doing so.
For existing Google Cloud projects, you'll have to enable the API and download the credentials in the Google Cloud Console. Simply search for the Google Drive API at the top and click enable. The OAuth credentials you'll need can be created and downloaded in the Credentials section under APIs and Services.
Once you've downloaded the credentials file, place it in your working directory and ensure it is named credentialsGDrive.json.
The first time a method from utils-google-drive is executed, you'll be prompted in the console to authorize the app. Follow the link and enter the code. A file named tokenGDrive.json containing an authorization token will be created in your working directory and setup will then be complete.
v1.0.3 — July 27, 2020
makeFolder
and upload
FAQs
A simple and flexible package for interacting with Google Drive
The npm package utils-google-drive receives a total of 4 weekly downloads. As such, utils-google-drive popularity was classified as not popular.
We found that utils-google-drive 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.