Avatar

easrng

👩‍💻🏳️‍⚧️ she/her
Joined June 5, 2023
Public vals
45
easrng avatar
uploadImage
@easrng
Script
uploadImage uploads an image to val.town just like when you paste an image into a readme
easrng avatar
kyselyVtDemo
@easrng
Script
Kysely on val.town Uses @easrng/kyselyVtDialect as a Kysely Dialect and @easrng/kyselyVtTypes for type autogeneration.
easrng avatar
kyselyVtTypes
@easrng
HTTP
Kysely type generator for @std/sqlite Usage Fork to your account. Update allowedTables to expose any tables you'd like to import the schema of. This will make their schemas public! Add import type { DB } from "https://yourusername-kyselyVtTypes.web.val.run/?tables=tables,you,need" to your program. See that QueryParams` type at the top? Add those to your URL to set more options. Demo See @easrng/kyselyVtDemo.
easrng avatar
kyselyVtDialect
@easrng
Script
Kysely Dialect for @std/sqlite Caveats It doesn't support transactions, there's no real way to do them on top of @std/sqlite AFAICT. Usage import { VtDialect } from "https://esm.town/v/easrng/kyselyVtDialect"; import { Kysely } from "npm:kysely"; const db = new Kysely({ dialect: new VtDialect(), }); Demo See @easrng/kyselyVtDemo, which uses this along with @easrng/kyselyVtTypes to generate schema types.
easrng avatar
generateOnce
@easrng
Script
An interactive, runnable TypeScript val by easrng
easrng avatar
sql
@easrng
Script
An interactive, runnable TypeScript val by easrng
easrng avatar
encryption
@easrng
Script
good for session cookies or whatevs
easrng avatar
resilientFetch
@easrng
Script
resilientFetch : faster @std/fetch Try to fetch unproxied first, and fall back to proxied fetch if that fails.
easrng avatar
normalizeDomain
@easrng
Script
Normalize a domain. Handles trailing . and IDN.
easrng avatar
upgradeExpress
@easrng
Script
upgradeExpress Upgrade Express vals to the Web API without breaking existing consumers How it works upgradeExpress wraps a Web handler into a function that works as normal when called by the Web API, and redirects to the Web API when called by the Express API. Example I don't have an example for this per se but I used it to upgrade @easrng/button.
easrng avatar
signInWithValTownDemo
@easrng
HTTP
@easrng/signInWithValTown Demo An example of how to add authentication backed by val.town accounts to a val.
easrng avatar
user
@easrng
Script
An interactive, runnable TypeScript val by easrng
easrng avatar
alias
@easrng
Script
An interactive, runnable TypeScript val by easrng
easrng avatar
denoMediaTypes
@easrng
Script
/// Definition files don't have separate content types and so we have to "guess"
easrng avatar
consoleTests
@easrng
Script
An interactive, runnable TypeScript val by easrng
easrng avatar
playground
@easrng
HTTP
playground edit, run, and embed vals without requiring an account (or even js enabled!) caveats: logs don't stream I haven't set up codemirror only script vals supported everything else should be fully functional. you can prefill the editor with code: https://easrng-playground.web.val.run/?code=console.log(1) a val: https://easrng-playground.web.val.run/?load=easrng/playground some other url: https://easrng-playground.web.val.run/?load=https://any/other/url