1.3.0 • Published 2 months ago

upload-to-bunny v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Upload-to-Bunny

Upload-to-Bunny is a Node.JS library designed to simplify and speed up the process of uploading directories to BunnyCDN storage. With built-in support for parallel uploads and deleting old files, this library makes it easy to keep your BunnyCDN storage up-to-date.

Features

  • Upload entire directories to BunnyCDN storage
  • Parallel uploads for faster transfers
  • Option to clean the destination before uploading
  • Easily configurable with storage zone and access key

Installation

npm install --save upload-to-bunny

Usage

To use the Upload-to-Bunny library, simply import it and call the uploadToBunny function with the appropriate options:

uploadToBunny(sourceDirectory, destinationDirectory, options);

Example

import uploadToBunny from 'upload-to-bunny';

await uploadToBunny('/path/to/local/directory', '', {
  storageZoneName: 'your-storage-zone-name',
  cleanDestination: true,
  accessKey: 'your-bunny-access-key',
  maxConcurrentUploads: 10
});

Options

The uploadToBunny function accepts the following options:

  • storageZoneName (string, required): The name of your BunnyCDN storage zone.
  • cleanDestination (boolean, optional): If set to true, the target directory will be cleaned before uploading. Default is false.
  • accessKey (string, required): Your BunnyCDN access key.
  • maxConcurrentUploads (number, optional): The maximum number of files to upload concurrently. Default is 10.

Example

import uploadToBunny from 'upload-to-bunny';

await uploadToBunny('/path/to/local/directory', '', {
  storageZoneName: 'test-storage-12345',
  cleanDestination: true,
  accessKey: 'xxxxxxxxxx-xxxx-xxxx-xxxx',
  maxConcurrentUploads: 10
});

Contributing

Contributions are always welcome! If you have any suggestions, bug reports, or feature requests, feel free to open an issue or submit a pull request.

1.3.0

2 months ago

1.2.0

4 months ago

1.1.0

4 months ago

1.0.6

6 months ago

1.0.5

10 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago