• pomdtr avatar
    valshot
    @pomdtr
    Forked from vladimyr/valshot
    HTTP
  • nbbaier avatar
    ideaList
    @nbbaier
    Forked from pomdtr/article
    Script
  • nbbaier avatar
    blobEditor
    @nbbaier
    Forked from pomdtr/blob_editor
    Script
  • nbbaier avatar
    vtWishList
    @nbbaier
    My Val Town Wish List Some things I'd love to see come to val town (some of these are already on the way according to the team) [x] Editing a val's readme through the API [x] A command bar (something like paco's cmdk would be dope ) [ ] The ability or programmatically respond to events (like a val being run) right within Val Town [ ] User defined templates usable right in the val creation flow [ ] Public folders / ability to add readmes to folders [ ] Dynamic folders (ala Tana's search nodes ) [ ] Custom val metadata (such as tags) [ ] A more fully featured markdown editor for readmes
    HTTP
  • pomdtr avatar
    mdx
    @pomdtr
    export const title = "mdx" {title} Usage import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo"; import { mdx } from "https://esm.town/v/pomdtr/mdx"; const { author, name } = extractValInfo(import.meta.url); export default mdx(author, name);
    HTTP
  • cooka avatar
    serve_readme
    @cooka
    Forked from pomdtr/serve_readme
    Script
  • pomdtr avatar
    cliOld
    @pomdtr
    Cli Vals Cli vals are a new type of val (same as http, email, cron and script vals). A cli val must use a function without args as it's default export. The function body will run on the user device using deno . An error message will be shown if deno is not installed. export default function() { if (Deno.args.length == 0) { console.error("<name> arg is required!"); Deno.exit(1); } console.log(`Hey ${Deno.args[0]}!`); } Fork @pomdtr/example_cli to get started. Of course, you can use a cli framework to parse arguments (ex: cliffy ). Running a cli val Go to https://pomdtr-cli.web.val.run/v/<author>/<name>[?v=<version>] to get a runnable script for your val. You can pipe the script to a shell to test it curl 'https://pomdtr-cli.web.val.run/v/pomdtr/cli_example' | sh -s Steve Hello Steve! Or save it to your $PATH . # save the script to the ~/.local/bin folder curl 'https://pomdtr-cli.web.val.run/v/pomdtr/cli_example' > ~/.local/bin/cli_example # make the script executable chmod +x ~/.local/bin/cli_example # run the installed val cli_example Steve Allowing cli vals to access private resources Cli vals run on your device, so by default they can only access public/unlisted vals. You can set the DENO_AUTH_TOKENS env var in your shell config to allow deno to import private vals. export DENO_AUTH_TOKENS=<your-token>@esm.town Cli vals don't have access to val town tokens. Instead of trying to replicate your valtown secrets locally, you can configure your cli vals to call your http endpoints using fetch .
    HTTP
  • pomdtr avatar
    raw
    @pomdtr
    Fetch the source of a val This val was created before the introduction of https://esm.town Usage curl https://pomdtr-raw.web.val.run/v/<author>/<name>.<extension>[?v=<version>] To see the code of this val, use https://pomdtr-raw.web.val.run/v/pomdtr/raw.ts Examples Fetching the val code $ curl https://pomdtr-raw.web.val.run/v/pomdtr/add.tsx You can also use js , jsx and ts extension (only the content-type change, there is no transpilation). Fetching private val Pass an api token as an username $ curl "https://<token>@pomdtr-raw.web.val.run/v/pomdtr/privateVal.ts" Fetching the val README $ curl https://pomdtr-raw.web.val.run/v/pomdtr/add.md Getting an image $ curl https://pomdtr-raw.web.val.run/v/pomdtr/add.png Fetching a specific version of a val $ curl https://pomdtr-raw.web.val.run/v/pomdtr/raw.ts?v=66 You need to be authenticated to use this method. Fetching the val metadata $ curl https://pomdtr-raw.web.val.run/v/pomdtr/add.json Running vals locally using Deno Create a new val.ts file referencing the @pomdtr.add import { add } from "https://pomdtr-raw.web.val.run/v/pomdtr/add.ts"; console.log(add(1, 2)); then use deno run $ deno run ./val.ts 3 If you val accept a request and return a response, you can pass it to Deno.Serve to run it locally! import {raw} from "https://pomdtr-raw.web.val.run/v/pomdtr/raw.ts"; Deno.serve(raw); If your val is private, you can set the DENO_AUTH_TOKENS env. DENO_AUTH_TOKENS=<val-town-token>@pomdtr-raw.web.val.run deno run val.ts
    HTTP
  • vladimyr avatar
    jsr2gh
    @vladimyr
    jsr2gh Redirect to jsr package's GitHub repository page, like vladimyr-jsr2gh.web.val.run/@luca/flag Usage https://vladimyr-jsr2gh.web.val.run/<scope>/<name> Example https://vladimyr-jsr2gh.web.val.run/@luca/flag https://vladimyr-jsr2gh.web.val.run/@std/assert
    HTTP
  • pomdtr avatar
    article
    @pomdtr
    Use readme as website Usage import {article} from "https://esm.town/v/pomdtr/article" export default article() See this val http endpoint as an example: https://pomdtr-article.web.val.run
    HTTP
  • pomdtr avatar
    renderGist
    @pomdtr
    Render Gist Usage Go to a gist page, and replace gist.github.com by pomdtr-renderGist.web.val.run Example: https://pomdtr-renderGist.web.val.run/probonopd/9feb7c20257af5dd915e3a9f2d1f2277
    HTTP
  • pomdtr avatar
    readme
    @pomdtr
    An interactive, runnable TypeScript val by pomdtr
    Script
  • nbbaier avatar
    vtghBlog
    @nbbaier
    An interactive, runnable TypeScript val by nbbaier
    Script
  • rlesser avatar
    dependency_graph
    @rlesser
    An interactive, runnable TypeScript val by rlesser
    HTTP
  • pomdtr avatar
    blob_editor
    @pomdtr
    Preview and edit blobs Usage: import blobEditor from "https://esm.town/v/pomdtr/blob_editor" export default blobEditor("article.md") You can easily protect your val behind @pomdtr/password_auth or @pomdtr/email_auth
    HTTP
  • pomdtr avatar
    embed_demo
    @pomdtr
    An interactive, runnable TypeScript val by pomdtr
    HTTP
March 6, 2024