Public
Like
11
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: v33View latest version
This CLI tool allows you to quickly upload files or text content to the File Dumper service directly from your terminal.
You can pipe content to the CLI tool, which will upload it and return a shareable URL:
# Upload a file cat path/to/file.jpg | deno run --allow-net --allow-env https://esm.town/v/wolf/FileDumpThing/cli/upload.ts file.jpg # Upload text echo "Hello World" | deno run --allow-net --allow-env https://esm.town/v/wolf/FileDumpThing/cli/upload.ts note.txt # Upload from clipboard (macOS) pbpaste | deno run --allow-net --allow-env https://esm.town/v/wolf/FileDumpThing/cli/upload.ts clipboard.txt
- The optional filename argument helps determine the MIME type of the content
- If no filename is provided, the content is treated as plain text
For easier usage, you can create an alias in your shell configuration:
# Add to your .bashrc, .zshrc, etc. alias filedump='deno run --allow-net --allow-env https://esm.town/v/wolf/FileDumpThing/cli/upload.ts'
Then use it like:
cat image.png | filedump image.png
# Upload an image and open it in browser cat screenshot.png | deno run --allow-net --allow-env https://esm.town/v/wolf/FileDumpThing/cli/upload.ts screenshot.png | xargs open # Upload and copy URL to clipboard (macOS) cat document.pdf | deno run --allow-net --allow-env https://esm.town/v/wolf/FileDumpThing/cli/upload.ts document.pdf | pbcopy # Upload and copy URL to clipboard (Linux with xclip) cat document.pdf | deno run --allow-net --allow-env https://esm.town/v/wolf/FileDumpThing/cli/upload.ts document.pdf | xclip -selection clipboard
- The URL is output to stdout without any additional text, making it easy to pipe to other commands
- The CLI uses the same blob storage as the web interface
- Content is stored with the same retention policy as the web interface