Search

Results include substring matches and semantically similar vals. Learn more
stevekrouse avatar
untitled_Secret
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import process from "node:process";
export function untitled_Secret() {
return [process.env.test, process.env.test];
stevekrouse avatar
untitled_return_me_val
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { private_library_val } from "https://esm.town/v/stevekrouse/private_library_val";
export function untitled_return_me_val() {
return private_library_val;
sahaj_northeastern avatar
untitled_greenWoodpecker
@sahaj_northeastern
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
karan_mor avatar
untitled_bronzeCanidae
@karan_mor
// Sends an email with the joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
moeykens_n avatar
untitled_moccasinDragon
@moeykens_n
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
boucher avatar
untitled_blackBee
@boucher
Deprecated in favor of std/sqlite (also powered by Turso) std/turso was the initial version of our integration with Turso. It was so popular, we rebuilt it to be faster and easier to use: std/sqlite . Turso is a serverless SQLite platform designed for the edge. It runs libSQL , their open contribution fork of SQLite. Every Val Town user automatically gets their own Turso SQLite database! It's great for >100kb data (ie bigger than a val) or when you need SQL: relations, ACID transactions, etc. Storage used in Turso will count against your Val Town total storage (10mb for free users; 1gb for Pro users). Contact us if you'd need more – it should be no problem! Getting started This val uses our public key auth scheme . Generate your keypair On your publicKey click the lock icon🔒 to change the permissions to Unlisted . Fork this helper function replacing stevekrouse with your own username Try out some queries! Usage This val returns a Turso SDK's Client , which supports execute , batch , and transaction . await @me.turso().execute(`create table blobs( key text unique, value text )`) More example usage Architecture This @std.turso function is the client or SDK to @std.tursoAPI, which acts as a "proxy" to Turso. It handles authentication, creates databases, and forwards on your SQL queries. You can get lower latency (~200ms vs ~800ms), more storage, databases, CLI & API access by having your own Turso account.
Script
2. On [your publicKey](https://www.val.town/v/me/publicKey) click the lock icon🔒 to change the permissions to `Unlisted`.
3. [Fork this helper function](https://www.val.town/v/stevekrouse.turso/fork) replacing `stevekrouse` with your own username
4. [Try out some queries!](https://www.val.town/v/stevekrouse.tursoExamples/fork)
## Architecture
This @std.turso function is the client or SDK to @std.tursoAPI, which acts as a "proxy" to Turso. It handles authentication,
type createClient = Awaited<ReturnType<typeof tursoImport>>["createClient"];
export function turso(keys, handle?) {
let val = "@std.tursoAPI";
transaction: f("transaction") as ReturnType<createClient>["transaction"],
export const endpoint = function(req, res) {
res.end("hello, world!");
achitnis086 avatar
untitled_brownGrasshopper
@achitnis086
// Fetches a random joke
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
weinsteinalex avatar
untitled_turquoiseHornet
@weinsteinalex
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
mike968 avatar
untitled_coffeeElk
@mike968
// Sends an email with the joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
rohansolo156 avatar
untitled_coffeeMarten
@rohansolo156
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
maijason avatar
untitled_aquamarineBlackbird
@maijason
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
tmcw avatar
untitled_beigeCrab
@tmcw
An interactive, runnable TypeScript val by tmcw
HTTP
export async function handle() {
// Schedule work to do later
new Promise<void>(async (resolve) => {
anniepeak avatar
untitled_blushLobster
@anniepeak
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
moouhss avatar
untitled_indigoKangaroo
@moouhss
An interactive, runnable TypeScript val by moouhss
Script
import { email } from "https://esm.town/v/std/email?v=11";
export async function emailRandomJoke() {
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
llary24 avatar
untitled_oliveTapir
@llary24
// Fetches a random joke.
Cron
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",