Storage Broth
A tasty NodeJS broth to which you can add your own file storage ingredients.
Install
npm install storage-broth
Initialization
First, require the module and store it in a variable.
const broth =
Then, create a new initialized instance with your config.
Local File System
const store =
AWS S3
const store =
Crypto
The crypto functions can be used in conjunction with any storage type. These
values are required to be able to use saveCryptoFile()
and getCryptoFile()
.
Note that you can still call these functions without initializing them, but they will have empty values for secret and salt, which is obviously not secure ;)
const store =
Usage
Plain
const someData = 'something-you-want-to-store'const relativePath = '/my-folder/filename' store
Crypto
const someData = 'something-you-want-to-store'const relativePath = '/my-folder/filename' store