Socket
Book a DemoInstallSign in
Socket

bunnycdn-node

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bunnycdn-node

[![CircleCI](https://circleci.com/gh/UintaGroup/bunnycdn-node.svg?style=svg)](https://circleci.com/gh/UintaGroup/bunnycdn-node) [![Coverage Status](https://coveralls.io/repos/github/UintaGroup/bunnycdn-node/badge.svg?branch=master)](https://coveralls.io/g

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
16
700%
Maintainers
1
Weekly downloads
 
Created
Source

bunnycdn-node

CircleCI Coverage Status Build Status

BunnyCDN node.

A simple utility for working with bunnycdn's APIs

This was initially planned to be a simple utility for us to use to update js files on Bunny's storage platform and then bust their cache after a deployment.

Installation

$ npm install bunnycdn-node

set the following environment variables

  • BUNNY_API_KEY
  • BUNNY_STORAGE_API_KEY

Usage

import

import { Bunny } from 'bunnycdn-node';
...
const bunny = new Bunny();

Storage

All files in Storage Zone

const files: StorageZoneFile[] = await bunny.storage.get('mystoragezone');

Contents of specific file

const fileContents: string = await bunny.storage.getFile('mystoragezone/somepath/afile.js');

Update Contents of specific file

bunny.storage.update('mystorage/somepath/afile.js', 'console.log(\'I was updated\');');

Delete specific file

bunny.storage.delete('mystorage/somepath/afile.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://my-zone/mypath/filetopurge.css');

HardUpdate File (Update and Purge)

bunny.hardUpdate('https://mydomain.com','myStorage', 'myPath', 'fileName.css', 'new file contents');

FAQs

Package last updated on 03 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.