npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@inteli.city/node-red-contrib-drive-collection

v1.0.1

Published

Node-RED nodes for Google Drive and OneDrive file operations

Downloads

45

Readme

node-red-contrib-drive-collection

Node-RED nodes for Google Drive and OneDrive file operations.

A single drive node performs all operations (upload, download, list, delete) against a provider chosen on the linked drive-config.


Nodes

| Node | Type | Purpose | |---|---|---| | drive-config | config | Provider selection + OAuth2 credentials | | drive | operation | upload / download / list / delete |


drive-config

Shared credentials and provider selection.

| Field | Description | |---|---| | Provider | Google Drive or OneDrive | | Tenant ID | Azure AD tenant (OneDrive only) | | Client ID | OAuth2 client ID | | Client Secret | Stored as a credential | | Refresh Token | Paste manually from your OAuth flow |

The access token is refreshed automatically in memory and is never persisted.


drive

Unified node. Pick an operation in the editor (or override per-message via msg.operation).

Operations

| Operation | Required input | Output | |---|---|---| | upload | source per Input Source mode | msg.payload = metadata, msg.fileId = uploaded ID | | download | fileId | per Output Target mode (see below) | | list | none (defaults to root) | msg.payload = array of file metadata | | delete | fileId (or path for OneDrive) | msg.payload = { deleted: true, fileId \| path } |

Upload — Input Source modes

| Mode | Behavior | |---|---| | payload (default) | Reads from msg.payload (Buffer or stream). msg.filePath is ignored. | | file | Reads from the configured File Path (or msg.filePath). msg.payload is ignored. |

Download — Output Target modes

| Mode | Behavior | |---|---| | payload (default) | msg.payload is the readable stream returned by the provider. | | file | Streams the response directly to the local filesystem. msg.payload becomes { filePath, fileId }; msg.filePath is also set. Set Overwrite to allow replacing existing files. |

File modes touch the local filesystem at runtime and may not work across environments (Docker, cloud). Ensure the Node-RED process can read/write the selected paths.

Inputs

All inputs may be set on the node and overridden via msg:

| Property | Description | |---|---| | msg.operation | overrides node operation (upload, download, list, delete) | | msg.payload | upload body when Input Source is payload (Buffer or stream) | | msg.filename | upload filename (default: timestamp) | | msg.folderId | Google Drive folder ID | | msg.path | OneDrive path, e.g. Documents/file.txt | | msg.mimeType | upload MIME type (default: application/octet-stream) | | msg.fileId | target file ID for download / delete | | msg.filePath | local source path for upload when Input Source is file | | msg.outputFilePath | local destination path for download when Output Target is file |

Provider constraints

  • Google Drive does not support path. Use folderId.
  • OneDrive upload requires path.

Errors

All errors are normalized to { code, message } and surfaced via node.error() and the status badge. Codes:

| Code | Meaning | |---|---| | INVALID_INPUT | Required input missing or empty | | INVALID_OPERATION | Operation is not one of the four supported | | UNSUPPORTED_INPUT | Input not supported for this provider (e.g. path on Google) | | MISSING_CONFIG | drive-config not linked | | PROVIDER_NOT_INITIALIZED | Config node failed to initialize the provider | | NOT_FOUND | API returned 404 | | UNAUTHORIZED | API returned 401 / token refresh failed | | FORBIDDEN | API returned 403 | | FILE_EXISTS | Local destination file exists and Overwrite is off | | LOCAL_IO_ERROR | Local filesystem read/write failure | | PROVIDER_ERROR | Other API failure |

Raw provider errors are not propagated.


Node status

| Color | Meaning | |---|---| | Yellow | In progress (shows operation name) | | Green | Success (ok) | | Red | Error (shows error code) |


OAuth2 Bootstrap

These nodes use OAuth2 with a refresh token. Obtain it externally:

  • Google DriveOAuth2 Playground with scope https://www.googleapis.com/auth/drive
  • OneDrive — Azure app registration with scope Files.ReadWrite

Paste the refresh token directly into the config node. The nodes do not implement a UI for the initial OAuth flow.


Design

  • One unified node, one operation per message
  • Config node as single source of truth for credentials
  • msg.* overrides always win over node config
  • Streams over buffering — download returns a stream, not a Buffer
  • Provider-specific logic lives behind a uniform { upload, download, list, delete } interface
  • Errors are normalized to { code, message } — no raw provider errors leak
  • Manual OAuth bootstrap — no hidden auth flows

License

Apache-2.0