bunnycdn-storage
a small wrapper for the bunnycdn storage api
Building
install dependencies with npm/yarn and then run npm build
or yarn build
Usage
const BunnyStorage = require('bunnycdn-storage').default;
const bunnyStorage = new BunnyStorage('API-KEY', 'STORAGE-ZONE-NAME');
const files = await bunnyStorage.list();
const filesInDir = await bunnyStorage.list('/images');
bunnyStorage.upload('/tmp/bunny.jpg');
bunnyStorage.upload(fs.readFileSync('/tmp/bunny.jpg'), 'bunny.jpg')
bunnyStorage.download('bunny.jpg');
bunnyStorage.download('bunny.jpg', 'arraybuffer');
bunnyStorage.download('bunny.jpg', 'stream');
bunnyStorage.delete('bunny.jpg');