Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=function&page=1369&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 16586 results for "function"(1318ms)

2// We'll embed the CSS directly in the HTML for simplicity.
3
4export default async function(req: Request): Promise<Response> {
5 const html = `
6 <!DOCTYPE html>
2// We'll handle the form submission using a POST request.
3
4export default async function(req: Request): Promise<Response> {
5 const html = `
6 <!DOCTYPE html>
1// This val serves an HTML page with an input field to enter a name and greets the user when the form is submitted.
2
3export default async function(req: Request): Promise<Response> {
4 const decoder = new TextDecoder();
5 const formData = new URLSearchParams(decoder.decode(await req.arrayBuffer()));
3
4/**
5 * This function handles incoming HTTP requests and returns a styled HTML response.
6 */
7export default function(req: Request): Response {
8 // The CSS styles we will apply
9 const css = `
1// This Val will respond with a simple "Hello World" message styled with CSS
2
3export default function(req: Request): Response {
4 // Define the HTML content with a styled message
5 const htmlContent = `
2// We'll embed the CSS directly in the HTML for simplicity.
3
4export default async function(req: Request): Promise<Response> {
5 const html = `
6 <!DOCTYPE html>
7 */
8
9export default async function(req: Request): Promise<Response> {
10 const htmlContent = `
11 <!DOCTYPE html>
7 */
8
9export default async function(req: Request): Promise<Response> {
10 const htmlContent = `
11 <!DOCTYPE html>
7 */
8
9export default async function(req: Request): Promise<Response> {
10 return new Response("Hello world", {
11 headers: { "Content-Type": "text/plain" },
3// No external libraries or other dependencies are necessary.
4
5export default async function(req: Request): Promise<Response> {
6 // Return a simple JSON response
7 return Response.json({ message: "Hello, world!" });

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",