moleculer-flydrive
Fluent storage manager service with Node Flydrive.
You need to install @slynova/node-flydrive
Features
- Local
- Amazon S3 (You need to install aws-sdk package to be able to use this driver)
- Digital Ocean Spaces (You need to install aws-sdk package to be able to use this driver)
- FTP (You need to install jsftp package to be able to use this driver)
- Possibility to register a custome driver like Google Drive driver
Instalation
npm install moleculer-flydrive
Usage
With no settings (it will mount local storage driver by default with the current directory as root dir)
"use strict"const FlyDrive = ;const ServiceBroker = ;const broker = ;broker
With settings
"use strict"const FlyDrive = ;const ServiceBroker = ;const broker = ;//when true passed as param the service will try to create the root dirbroker
Register a custom drive
"use strict"const FlyDrive = ;const GoogleDrive = ;const ServiceBroker = ;const broker = ;//when true passed as param the service will try to create the root dirbroker
Settings
Property | Type | Description |
---|---|---|
STORAGE_ROOT |
String |
The root directory for local storage driver |
defaultStorage |
String |
the default driver to use, if not sepecified, local will be used |
storageConfig |
Object |
the configuration object, refer to Configuration object for more details |
Methods
Name | Params | Result | Description |
---|---|---|---|
disk | String or undefined |
Storage instance |
get a specifique disk storage or the default storage if no param passes. |
extends | name:String ,driver: Object constructor |
the StorageManager instance |
extends the storage manager, the new driver configuration should have been defined in configuration. Refer to How to register custome driver |
Test
You can run npm run test
to run tests
Licence
MIT