Public
Like
10
FileDumpThing
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v59View latest version
A simple CLI tool for uploading files to the File Dumper service.
# Upload a file cat path/to/file.jpg | deno run --allow-net https://esm.town/v/wolf/FileDumpThing/cli/upload.ts file.jpg # Upload text echo "Hello World" | deno run --allow-net https://esm.town/v/wolf/FileDumpThing/cli/upload.ts note.txt
The filename argument is optional but helps identify the file in the URL.
The CLI automatically detects whether the input is text or binary:
- Text content is uploaded as plain text
- Binary content is uploaded as a file
This detection happens by checking for null bytes and validating UTF-8 encoding.
# Upload and open in browser cat image.png | deno run --allow-net https://esm.town/v/wolf/FileDumpThing/cli/upload.ts image.png | xargs open # Upload and copy URL to clipboard (macOS) cat document.pdf | deno run --allow-net https://esm.town/v/wolf/FileDumpThing/cli/upload.ts document.pdf | pbcopy # Upload text from clipboard (macOS) pbpaste | deno run --allow-net https://esm.town/v/wolf/FileDumpThing/cli/upload.ts notes.txt
For convenience, add this to your shell configuration:
alias filedump='deno run --allow-net https://esm.town/v/wolf/FileDumpThing/cli/upload.ts'
Then use:
cat image.png | filedump image.png
The CLI tool:
- Reads content from stdin
- Automatically detects if it's text or binary
- Uploads it to the API at
filedumpthing.val.run
- Returns a shareable URL