File storage nodes for Node-RED built with @bonsae/nrg. Read, write, and watch files across multiple storage backends with a unified API.
| 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 File Read, File Write, and File Watch 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:
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:
msg.filename- Path of the file that was written/deleted
Watches a directory on the local file system for file changes. No input port -- emits events automatically when files are created, modified, or deleted.
Config:
- Storage - File Storage configuration node (must be local file system)
- Watch Path - Subdirectory to watch (empty = entire root)
- Recursive - Watch subdirectories recursively
Output:
msg.payload- Relative path of the changed filemsg.event-created,modified, ordeletedmsg.filename- Relative path of the changed file
File Watch only works with the Local File System backend. Selecting a non-local storage will show an error.
# Install dependencies
pnpm install
# Start dev server (Node-RED with hot reload)
pnpm dev
# Build for production
pnpm build
# Run checks
pnpm tsc:client && pnpm tsc:server
pnpm lint
pnpm format:check
pnpm test