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=1759&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 18321 results for "function"(1492ms)

addTaskmain.tsx1 match

@ju2l0r•Updated 1 year ago
2import { tasks } from "https://esm.town/v/ju2l0r/tasks";
3
4export async function addTask(title) {
5 const newTask = {
6 id: Math.max(...tasks.map((t) => t.id)) + 1,

getmain.tsx1 match

@cyx•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function get() {
4 let places = [
5 {

logTestmain.tsx1 match

@twschiller•Updated 1 year ago
1export function logTest() {
2 const levels = ["info", "debug", "log", "warn", "error"];
3 const result = {};

myApimain.tsx1 match

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

scrapeWebsitemain.tsx1 match

@oca99•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function scrapeWebsite(url) {
4 const { DOMParser } = await import(
5 "https://deno.land/x/deno_dom@v0.1.38/deno-dom-wasm.ts"

pocketmain.tsx1 match

@andreterron•Updated 1 year ago
1export function pocket() {
2 return {
3 hello: () => { return 'hi there' }

notionWordCounterFetchDaysmain.tsx1 match

@andreterron•Updated 1 year ago
3import { notionWordCounterDaysLastCached } from "https://esm.town/v/andreterron/notionWordCounterDaysLastCached";
4
5export async function notionWordCounterFetchDays() {
6 if (
7 notionWordCounterDaysLastCached >

myApimain.tsx1 match

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

sampleFirehosemain.tsx3 matches

@lukas•Updated 1 year ago
1export async function sampleFirehose() {
2 const cborx = await import("https://deno.land/x/cbor@v1.5.2/index.js");
3 const multiformats = await import("npm:multiformats");
143 return decoded;
144 };
145 async function* byFrame(ws: WebSocketStream) {
146 const { readable } = await ws.connection;
147 const reader = readable.getReader();
156 }
157 }
158 async function* byMessage(ws: WebSocketStream) {
159 for await (const frame of byFrame(ws)) {
160 if (frame.isMessage()) {

myApimain.tsx1 match

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

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.