Skip to content

intelrug/bunnycdn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@intelrug/bunnycdn

NPM Version Package License NPM Downloads

Install

$ yarn add @intelrug/bunnycdn

Usage

import

import { BunnyCDN } from '@intelrug/bunnycdn';
...
const bunny = new BunnyCDN({
    apiAccessKey: 'your-key',
    storageZones: [{
        name: 'your-storage-zone-name',
        accessKey: 'your-storage-zone-access-key'
    }],
});
...

Storage

All files in Storage Zone

const files: StorageZoneFile[] = await bunny.storage.get('your-storage-zone-name');

Get contents of specific file

const fileContents: string = await bunny.storage
    .getFile('your-storage-zone-name', 'somepath/script.js');

Create a file or update contents of specific file

bunny.storage.update(
    'your-storage-zone-name',
    'somepath/script.js',
    'console.log(\'I was updated\');'
);

Delete specific file

bunny.storage.delete('your-storage-zone-name', 'somepath/script.js');

Bunny API

Get Billing

const billing: Billing = await bunny.billing();

Get Statistics

const stats : Statistic = await bunny.statistics();

Purge File Cache

bunny.purge('http://your-zone/somepath/filetopurge.css');

HardUpdate File (Update and Purge)

bunny.hardUpdate(
    'https://your-domain.com',
    'your-storage',
    'somepath',
    'fileName.css',
    'new file contents'
);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors