A simple client for the BunnyCDN API.
I started writing this module, before I found out there was already a similar module, which is complete and tested. So, I have stopped developing this module for now, and I recommend using the other one. I will resume development if the other module is deprecated.
NOTICE: I have unpublished this module from npm to prevent cluttering the registry.
npm install bunnycdn
const bunnycdn = require('bunnycdn')
const client = bunnycdn({
apiKey: 'YOUR-API-KEY'
})
client.pullzone.list()
.then(console.log)
.catch(console.error)
client.billing.applycode(data)
client.pullzone.update(id, data)
client.pullzone.purgeCache(id)
client.pullzone.addHostname(data)
client.pullzone.deleteHostname(data)
client.pullzone.setForceSSL(data)
client.pullzone.loadFreeCertificate(data)
client.pullzone.addCertificate(data)
client.pullzone.addBlockedIp(data)
client.pullzone.removeBlockedIp(data)
client.storagezone.create(data)
The storage API documentation is separate from the main API docs.
All HTTP errors will have a status
and message
property. Where status
will be the HTTP status code (ex. 500), and message
will be the corresponding error message (ex. Internal Server Error). If the API response contains a body
property, it will also be present on the error object.