Skip to content
/ hcload Public

Upload files to Hackclub's CDN using your CLI

License

Notifications You must be signed in to change notification settings

khrj/hcload

Repository files navigation

Hand with phone showing paper plane which is being tapped; Paper plane flying away out of phone

hcload

Upload files to the Hack club CDN via Deno and your CLI

build status language code size issues license version

View on deno.land




Table of contents:

API

hcload offers a convenient deno API

import hcload from "https://deno.land/x/hcload@1.3.2/mod.ts"
const urls: string[] = await hcload({
    files: fullPaths,
    urls: YourUrls,
})

Where

  • fullPaths is an array of complete filesystem paths to files
  • urls is an array of urls

Only one parameter is nessecary

CLI

Make sure you have deno

Installation

deno install -A https://deno.land/x/hcload/hcload.ts

then run (see usage)

hcload -f filename.mp3

Permissions

Needs the following

  • --allow-env
  • --allow-net
  • --allow-read=~/.ngrok-deno
  • --allow-write=~/.ngrok-deno
  • --allow-run

Or just

  • -A

Usage

Usage: hcload -f [files...] -u [urls...]

Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]
  -f, --files    Path to file(s) to upload                               [array]
  -u, --urls     URL(s) to host on CDN                                   [array]
  -s, --silent   Do not print "Working..."                              [boolean]

Examples:
  hcload -f myPic.png                                      Upload one file
  hcload -f myPic.png vid.mp4 song.mp3                     Upload multiple files
  hcload -u https://b.me/foo.mp3                           Upload from one URL
  hcload -u https://a.me/foo.mp3 https://a.me/foo.jpg      Upload from multiple URLs
  hcload -u https://a.me/foo.mp3 -f myPic.png myMusic.mp3  Upload from file[s] and URL[s]

Supporters

Stargazers repo roster for @khrj/hcload

Forkers repo roster for @khrj/hcload

Related