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/$%7Bart_info.art.src%7D?q=function&page=1671&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 18590 results for "function"(5536ms)

untitled_indigoWrenmain.tsx1 match

@tmcw•Updated 1 year ago
1import { delay } from "https://deno.land/std/async/delay.ts";
2
3async function write(text: string) {
4 const textEncoder = new TextEncoder();
5 const data = textEncoder.encode(text);

untitled_indigoWrenmain.tsx1 match

@tmcw•Updated 1 year ago
1import { delay } from "https://deno.land/std/async/delay.ts";
2
3async function write(text: string) {
4 const textEncoder = new TextEncoder();
5 const data = textEncoder.encode(text);

uploadByURLmain.tsx1 match

@stevedylandev•Updated 1 year ago
1const JWT = Deno.env.get("PINATA_JWT");
2
3 export default async function uploadByURL(url){
4 try {
5 const urlStream = await fetch(url)

search_heroiconsmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
2
3export default async function(ctx: BrowserContext) {
4 const resp = await fetch("https://api.iconify.design/collection?prefix=heroicons");
5 if (!resp.ok) {

val_to_listitemmain.tsx1 match

@pomdtr•Updated 1 year ago
1export function valToListItem(val) {
2 return {
3 title: `${val.author.username}/${val.name}`,

sqliteExplorerAppREADME.md1 match

@nbbaier•Updated 1 year 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
37

glifJsonmain.tsx1 match

@cjpais•Updated 1 year ago
3export const glifJson = async (id: string) => {
4 const getRandom = (list) => {
5 const shuffledList = list.sort(function () {
6 return 0.5 - Math.random();
7 });

mgsrBotEndpointmain.tsx1 match

@rayman•Updated 1 year ago
60 }));
61 break;
62 // Helper function to show the user an ephemeral message how to undo a recorded game.
63 case "Undo Help":
64 res.json({

copy_textmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
2
3export default async function(ctx: BrowserContext<{ text: string }>) {
4 return {
5 type: "copy",

open_urlmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
2
3export default async function(ctx: BrowserContext<{ url: string }>) {
4 return {
5 type: "open",

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