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=1482&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 18380 results for "function"(1911ms)

caniuse_notifiermain.tsx2 matches

@gunnnnii•Updated 9 months ago
7const dataKey = "caniuse-data";
8
9function Feature({ feature }: any) {
10 const links = feature.links ?? [];
11 return (
27}
28
29export default async function(interval: Interval) {
30 const previousDataUpdatedAt = await blob.getJSON(updatedKey) ?? 0;
31 const previousData = await blob.getJSON(dataKey);

twitterRAGmain.tsx1 match

@levi•Updated 9 months ago
58
59// Render streaming markdown
60export default async function handler(req: Request): Promise<Response> {
61 const renderMarkdown = (await import("https://esm.town/v/substrate/renderMarkdown")).default;
62 return renderMarkdown(stream);

intromain.tsx1 match

@cw12•Updated 9 months ago
10const stream = await substrate.stream(summary);
11
12export default async function render(req: Request): Promise<Response> {
13 if (new URL(req.url).pathname === "/robots.txt") {
14 return new Response("User-agent: *\nDisallow: /");

valmain.tsx2 matches

@dvdsgl•Updated 9 months ago
3type Handler<T> = (req: Request) => T;
4
5export function http<E>(effect: Handler<Effect.Effect<Response, E>>): Handler<Promise<Response>> {
6 return async req => {
7 const exit = await Effect.runPromiseExit(effect(req));
13}
14
15export function requestJSON<T>(r: Request) {
16 return Effect.tryPromise(() => r.json() as Promise<T>).pipe(
17 Effect.catchAll(() => Effect.fail(`Could not parse Request as JSON`)),

sqliteAdminREADME.md1 match

@kamalnrf•Updated 9 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

valREADME.md1 match

@dvdsgl•Updated 9 months ago
11import * as Val from "https://esm.town/v/dvdsgl/val";
12
13export default Val.http(req => Effect.gen(function*(){
14 return Response.json({ ok: true, love: "effect" });
15}));

btcPriceAlertmain.tsx1 match

@fahmi•Updated 9 months ago
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");

linkInBioTemplatemain.tsx1 match

@susl•Updated 9 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

MinnehahaCreekFlowAlertsmain.tsx1 match

@judson•Updated 9 months ago
2import { email } from "https://esm.town/v/std/email?v=9";
3
4export async function flowLevels(interval: Interval) {
5 const data = await getFlowLevel();
6 let goodConditions = false;

MinnehahaFlowLevelmain.tsx3 matches

@judson•Updated 9 months ago
52}
53
54function getCurrentValue(jsonData: Data, locationKey: string): CurrentValueCorrected | undefined {
55 const location = jsonData.locations[locationKey];
56 const currentLocation = location ? location.current_value : undefined;
61}
62
63async function getData() {
64 const url = "https://minnehahacreek.org/data-json/request/";
65
76}
77
78export async function getFlowLevel() {
79 const data = await getData();
80 const graysBayDamCurrentValue = getCurrentValue(data, "mcwdgraysdischarge");

getFileEmail4 file matches

@shouser•Updated 1 week 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
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.