File storage nodes for Node-RED built with @bonsae/nrg. Read and write files across multiple storage backends with a unified API.
| Node | Description |
|---|---|
| File Storage | Config node — selects and configures a storage backend (local, S3, GCS, or Azure) shared by the read/write nodes |
| File Read | Read a file from the configured backend as a string, Buffer, or readable stream |
| File Write | Write, append, or delete a file in the configured backend |
| Backend | Adapter | Use Case |
|---|---|---|
| Local File System | @flystorage/local-fs |
Development, edge deployments |
| Amazon S3 | @flystorage/aws-s3 |
Also works with R2, DigitalOcean Spaces, MinIO |
| Google Cloud Storage | @flystorage/google-cloud-storage |
GCP workloads |
| Azure Blob Storage | @flystorage/azure-storage-blob |
Azure workloads |
npm install @bonsae/node-red-file-storageCloud SDKs are optional dependencies. They are only needed if you use the corresponding backend:
# For S3
npm install @aws-sdk/client-s3
# For Google Cloud Storage
npm install @google-cloud/storage
# For Azure Blob Storage
npm install @azure/storage-blobConfigures a storage backend shared by the File Read and File Write nodes. Each backend has its own set of configuration fields:
- Local: Root directory path
- S3: Bucket, region, optional prefix. Credentials via Access Key ID / Secret Access Key
- GCS: Bucket, project ID, optional prefix. Credentials via service account key file
- Azure: Container, optional prefix. Credentials via connection string
Reads a file from the configured storage backend.
Config:
- Storage - File Storage configuration node
- File Path - Path relative to the storage root (supports
strormsgtypes) - Output As -
string,buffer, orstream - Encoding - Character encoding when output is string (UTF-8, ASCII, Latin-1, etc.)
Input: Any message triggers the read.
Output — the read merges its fields onto the message (Node-RED's accumulating record); the incoming fields are preserved:
msg.payload- File content as string, Buffer, or Readable streammsg.filename- Path of the file that was read
Writes, appends, or deletes a file in the configured storage backend.
Config:
- Storage - File Storage configuration node
- File Path - Path relative to the storage root (supports
strormsgtypes) - Action -
overwrite,append, ordelete - Create Directory - Auto-create parent directories if they don't exist
- Add Newline - Append a trailing newline after data (append mode only)
- Encoding - Character encoding when writing string content
Input: msg.payload as string, Buffer, or Readable stream.
Output — merges its result field onto the message (Node-RED's accumulating record); the incoming fields are preserved:
msg.filename- Path of the file that was written/deleted
# Install dependencies
pnpm install
# Start the dev server (Node-RED with hot reload)
pnpm dev
# Build for production
pnpm build
# Type-check, lint, and format-check
pnpm validate
# Run unit tests
pnpm test