npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

bunny-client

v0.0.22

Published

TypeScript API Client for BunnyCDN 🐰

Downloads

1,400

Readme

bunny-client The TypeScript API Client for BunnyCDN 🐰

[!IMPORTANT]
Please use bunny-sdk-typescript instead. This repository is now in maintenance mode.

Motivation

Provide an unofficial TypeScript API Client for BunnyCDN with few dependencies.

Documentation

Supported APIs

  • πŸ—οΈ API
    • βœ… Countries
      • βœ… Get Country List
    • βœ… Support
      • βœ… Get Ticket List
      • βœ… Get Ticket Details
      • βœ… Close Ticket
      • βœ… Reply Ticket
      • βœ… Create Ticket
    • βœ… Region
      • βœ… Region List
    • πŸ—οΈ Stream Video Library
    • πŸ—οΈ DNS Zone
    • πŸ—οΈ Pull Zone
      • πŸ—οΈ List Pull Zones
      • πŸ—οΈ Add Pull Zone
      • πŸ—οΈ Get Pull Zone
      • πŸ—οΈ Update Pull Zone
      • πŸ—οΈ Delete Pull Zone
      • πŸ—οΈ Delete Edge Rule
      • πŸ—οΈ Add/Update Edge Rule
      • πŸ—οΈ Set Edge Rule Enabled
      • πŸ—οΈ Get Origin Shield Queue Statistics
      • πŸ—οΈ Get SafeHop Statistics
      • πŸ—οΈ Get Optimizer Statistics
      • πŸ—οΈ Load Free Certificate
      • πŸ—οΈ Purge Cache
      • πŸ—οΈ Check the pull zone availability
      • πŸ—οΈ Add Custom Certificate
      • πŸ—οΈ Remove Certificate
      • πŸ—οΈ Add Custom Hostname
      • πŸ—οΈ Remove Custom Hostname
      • πŸ—οΈ Set Force SSL
      • πŸ—οΈ Reset token Key
      • πŸ—οΈ Add Allowed Referer
      • πŸ—οΈ Remove Allowed Referer
      • πŸ—οΈ Add Blocked Referer
      • πŸ—οΈ Remove Blocked Referer
      • πŸ—οΈ Add Blocked IP
      • πŸ—οΈ Remove Blocked IP
    • πŸ—οΈ Purge
    • βœ… Statistics
      • βœ… Get Statistics
    • βœ… Storage Zone
      • βœ… List Storage Zones
      • βœ… Add Storage Zone
      • βœ… Check the Storage Zone Availability
      • βœ… Get Storage Zone
      • βœ… Update Storage Zone
      • βœ… Delete Storage Zone
      • βœ… Get Storage Zone Statistics
      • βœ… Reset Password
      • βœ… Reset Read-Only Password
  • βœ… Edge Storage API
    • βœ… Manage Files
      • βœ… Download File
      • βœ… Upload File
      • βœ… Delete File
    • βœ… Browse Files
      • βœ… List Files
  • πŸ—οΈ Stream API
    • πŸ—οΈ TUS
    • πŸ—οΈ Manage Collections
    • πŸ—οΈ Manage Videos

Quick start

Installation

Install via npm:

npm install bunny-client

Required polyfills

  • fetch API
  • Web Streams API

Supports Node.js 18+ and evergreen browsers

Account Access Key

Get your API Key from your account settings

API Key example:

cb1a7c68-89a0-462a-9495-13ebd7366cfe

Client

Each client matches with a menu item in the Bunny CDN docs

  1. Import the client
  2. Optionally set globals, like the apiKey
  3. Use the client methods to call the API

The main differences between the API and the TypeScript Client are:

  • camelCase inputs and outputs to match TypeScript style guides
  • tsdoc examples for all inputs and outputs
  • Replace the generic AccessKey with apiKey and storageZonePassword
  • More default parameters
const storageZoneClient = createStorageZoneClient({
  apiKey: API_ACCESS_KEY,
});

const response = await storageZoneClient("addStorageZone", {
  Name: "api-example",
  Region: "NY",
  ZoneTier: 1,
});

License

Alternative licenses available by request.

Contributing

PRs welcome! All contributors must sign the CLA Agreement so that the project license can be changed to MIT when sponsored. Thank you for your contributions.