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=1399&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 17278 results for "function"(2036ms)

1// This val responds with "Hello World" styled with crazy gradients in CSS
2export default async function main(req: Request): Promise<Response> {
3 const html = `
4 <!DOCTYPE html>
1// This val responds with "Hello World" to all incoming HTTP requests
2export default async function main(req: Request): Promise<Response> {
3 return new Response("Hello World", { headers: { "Content-Type": "text/plain" } });
4}
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
73}
74
75function renderStoryPage(storyId: string): string {
76 const stories = {
77 "1": {
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
65}
66
67function renderStoryPage(storyId: string): string {
68 const stories = {
69 "1": {
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
65}
66
67function renderStoryPage(storyId: string): string {
68 const stories = {
69 "1": {
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
65}
66
67function renderStoryPage(storyId: string): string {
68 const stories = {
69 "1": {
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
65}
66
67function renderStoryPage(storyId: string): string {
68 const stories = {
69 "1": {
131}
132
133function renderComments(comments: { user: string; text: string }[]): string {
134 return comments.map(comment => `
135 <div class="comment">
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
65}
66
67function renderStoryPage(storyId: string): string {
68 const stories = {
69 "1": {
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
65}
66
67function renderStoryPage(storyId: string): string {
68 const stories = {
69 "1": {
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
65}
66
67function renderStoryPage(storyId: string): string {
68 const stories = {
69 "1": {

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": "*",