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=2347&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 24460 results for "function"(7760ms)

expressHTMLExamplemain.tsx1 match

@prindom•Updated 1 year ago
1// View at https://prindom-expresshtmlexample.express.val.run/?name=Dominik
2export async function expressHTMLExample(
3 req: express.Request,
4 res: express.Response,

extractValArgsmain.tsx1 match

@sdan•Updated 1 year ago
2import { valToString } from "https://esm.town/v/sdan/valToString";
3
4export async function extractValArgs(val: string) {
5 const code = await valToString(val);
6 return extractArgs(code) as Promise<{

handleFormExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { email } from "https://esm.town/v/std/email?v=9";
3
4export async function handleFormExample(req, res) {
5 await email({
6 text: JSON.stringify(req.query, null, 2),

nakedAPIExmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function nakedAPIEx(req, res) {
2 res.send("my returned srting");
3}

runValmain.tsx1 match

@std•Updated 1 year ago
2import { API_URL } from "https://esm.town/v/std/API_URL";
3
4export function runVal(name, ...args) {
5 return fetch(`${API_URL}/v1/run/${name.replace("@", "")}`, {
6 method: "POST",

formatFeedDatemain.tsx1 match

@iakovos•Updated 1 year ago
1export function formatFeedDate(dateString: string): string {
2 const options: Intl.DateTimeFormatOptions = {
3 year: "numeric",

myApimain.tsx1 match

@johnlawver•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

api2main.tsx1 match

@endingwithali•Updated 1 year ago
1export function api2(req, res) {
2 res.send("<script>alert('hellow')</script>");
3}

myApimain.tsx1 match

@gjuggler•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}
1let { innerfeelingscounter } = await import("https://esm.town/v/politelyinvinciblepointer/innerfeelingscounter");
2
3export function increaseinnerfeelingscounter() {
4 innerfeelingscounter++;
5}

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.