Search

myApi
@willye
An interactive, runnable TypeScript val by willye
Script
export function myApi(name) {
return "hi " + name;

remember
@mxderouet
An interactive, runnable TypeScript val by mxderouet
Script
export let remember = function () {
console.email("Remember to try val.town for Weather Bot");
web_R95aGna5v9
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_R95aGna5v9(req) {
return new Response(`<!DOCTYPE html>
<html>
for (let i = 0; i < particleCount; i++) {
particles.push(new Particle());
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
particles.forEach(particle => {
ForestryFinancialModel
@jbwinters
// Interactive forestry financial model simulator.
HTTP
className="w-full"
function App() {
const [landSize, setLandSize] = useState(1000);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
client();
export default async function server(request: Request): Promise<Response> {
return new Response(`
valle_tmp_348423812438495525540884526013663
@janpaul123
// This val will respond with "Hello World" to any incoming HTTP request
HTTP
// This val will respond with "Hello World" to any incoming HTTP request
export default async function(req: Request): Promise<Response> {
return new Response("Hello World");

getOpenMeteoForecast
@wilt
// See https://open-meteo.com/en/docs for usage
Script
models?: string[];
cell_selection?: "land" | "sea" | "nearest";
export async function getOpenMeteoForecast(params: OMParams) {
const data = await fetchJSON(
`https://api.open-meteo.com/v1/forecast?${new URLSearchParams(
myApi
@chrisco
An interactive, runnable TypeScript val by chrisco
Script
export function myApi(name) {
return "hi " + name;
btrdb_kv_example
@yuuza
An interactive, runnable TypeScript val by yuuza
Script
await db.createSet("signData");
// 封装 get/set 操作
function getData(chatId, userId) {
return db.getSet("signData").get([chatId, userId]);
function setData(chatId, userId, data) {
return db.getSet("signData").set([chatId, userId], data);
// 调用 get/set

pipe
@adamgonda
An interactive, runnable TypeScript val by adamgonda
Script
export function pipe<T>(seed: T) {
return (...ops: Array<(state: T) => T>) =>
ops.reduce((state, action) => action(state), seed);
valle_tmp_69038696901412859657208359078762
@janpaul123
// This val responds with "Hello, World!" to all incoming HTTP requests
HTTP
// This val responds with "Hello, World!" to all incoming HTTP requests
export default async function main(req: Request): Promise<Response> {
return new Response("Hello, World!", { headers: { "Content-Type": "text/plain" } });
valle_tmp_318720770269803174245544142195994
@janpaul123
// This val will respond with "Hello, world!" to any HTTP request
HTTP
// This val will respond with "Hello, world!" to any HTTP request
export default async function (req: Request): Promise<Response> {
return new Response("Hello, world!");
valle_tmp_6579538930770234611834582082941192
@janpaul123
// This val will respond to any request with an HTML "Hello, world!" message with some fun CSS styles and an animated cat
HTTP
// This val will respond to any request with an HTML "Hello, world!" message with some fun CSS styles and an animated cat
export default async function(req: Request): Promise<Response> {
const html = `
<html>

myApi
@mmcc
An interactive, runnable TypeScript val by mmcc
Script
export function myApi(name) {
return "hi " + name;
valle_tmp_685210711636907459921294004623906
@janpaul123
// This val will respond to all HTTP requests with "Hello world"
HTTP
// This val will respond to all HTTP requests with "Hello world"
export default async function(req: Request): Promise<Response> {
return new Response("Hello world", {
headers: { "Content-Type": "text/plain" },