@edenjs/b2
v1.0.6
Published
nothing yet
Downloads
4
Readme
EdenJS - Backblaze B2
Backblaze B2 base logic component for EdenJS
@edenjs/b2
automatically adds the Backblaze B2 asset transport to your EdenJS installation
Setup
Install
npm i --save @edenjs/b2
Configure
config.b2 = {
id : '', // backblaze id
secret : '', // backblaze api key
bucket : '', // backblaze bucket name
domain : '', // (optional) cname or other domain that points to this bucket address
};
Example
// require model
const File = model('file');
// load file
const file = new File();
// await file creation
await file.fromFile('/local/file/location.pdf');
// save file
await file.save(); // this is now stored in backblaze
// get url for file
const url = await file.url(); // returns full url to download the file