Skip to content

Sample JavaScript code highlighting all of Bundlr's features.

Notifications You must be signed in to change notification settings

Tarz1k/bundlr-basics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bundler Basics

Code repository to accompany Bundlr SDK docs and this tutorial on using Bundlr with NodeJS.

Installation

  1. Clone the repository
  2. Run npm install from the project directory

Scripts

scripts/bundlr-basics.js A NodeJS script showing how to how to do the following using the Bundlr class:

  • Connecting to a node
  • Checking price to upload 1MB data
  • Checking loaded balance on a node
  • Funding a node
  • Withdrawing excess funds from a node
  • Uploading data
  • Uploading a file
  • Uploading a folder

scripts/chunked-uploader.js A NodeJS script showing how to use our Chunked Uploader to do the following:

  • Obtaining a reference to the chunked uploader
  • Setting batch size
  • Setting chunk size
  • Uploading in data mode
  • Uploading in transaction mode
  • Pausing the upload
  • Resuming a paused upload
  • Registering event callbacks

scripts/spa-uploader.js A NodeJS script showing how to use uploadFolder to upload an entire website to Arweave via Bundlr.

Assets

The scripts are designed to pull images and data from the assets folder when running. Sample assets are provided to make testing easier, feel free to change to anything you want.

Usage

The scripts are designed to run from beginning to end, executing the featured listed above in sequence. When testing, you're welcome to comment out features you don't need for your application.

Running bundlr-basics.js

cd scripts
node bundlr-basics.js

Running chunked-uploader.js

cd scripts
node chunked-uploader.js

About

Sample JavaScript code highlighting all of Bundlr's features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.2%
  • HTML 3.2%
  • CSS 1.6%