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/$%7Bsuccess?q=function&page=1830&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 18616 results for "function"(2350ms)

myApimain.tsx1 match

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

myApimain.tsx1 match

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

runHnBotTaskmain.tsx1 match

@owen•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function runHnBotTask(interval) {
4 console.log("interval", interval);
5

myApimain.tsx1 match

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

dlockmain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { parentReference } from "https://esm.town/v/stevekrouse/parentReference";
4
5export async function dlock({ id, ttl, release, lease }: {
6 id?: string;
7 ttl?: number;

updateThreadsafeStateExmain.tsx1 match

@stevekrouse•Updated 1 year ago
1let { threadsafeStateEx } = await import("https://esm.town/v/stevekrouse/threadsafeStateEx");
2
3export async function updateThreadsafeStateEx({ lease, state }) {
4 // TODO confirm it's me updating the state using auth
5 if (lease > threadsafeStateEx.lease) {

webassemblyExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
14 const importObj = {};
15 const { instance } = await WebAssembly.instantiate(source.buffer, importObj);
16 const addTwo = instance.exports.addTwo as CallableFunction;
17 return addTwo(20, 31);
18})();

svgAnimationmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function svgAnimation(req: express.Request, res: express.Response) {
2 res.set("content-type", "image/svg+xml");
3 res.end(`<svg

errorReportmain.tsx1 match

@estella0708•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3export async function errorReport(name) {
4 await email({ text: name });
5}

pageIncludesmain.tsx1 match

@glen•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let pageIncludes = async function (url, str) {
4 const f = await fetch(url);
5 const t = await f.text();

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks 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": "*",