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=1708&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 18162 results for "function"(3906ms)

markovChoicemain.tsx1 match

@jdan•Updated 1 year ago
1export function markovChoice(candidates: Record<string, number>) {
2 const totalWeight = Object.values(candidates).reduce((a, b) => a + b);
3 let result = null;

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

formatAsCurrencymain.tsx1 match

@panphora•Updated 1 year ago
1export function formatAsCurrency(num) {
2 let formatter = new Intl.NumberFormat("en-US", {
3 style: "currency",

myApimain.tsx1 match

@hibodog667•Updated 1 year ago
1export function myApi(name) {
2 console.email("name sent" + name);
3}

createReplitDBClientmain.tsx2 matches

@claytn•Updated 1 year ago
6 ARE JSON.stringify-ied SO RETURNED CLOSURES AREN'T SUPPORTED
7
8 USE THE INDIVIDUAL FUNCTIONS INSTEAD:
9 @claytn.replitGet
10 @claytn.replitSet
15/** Database client for replit's key-value store */
16
17export function createReplitDBClient(REPLIT_DB_URL) {
18 return {
19 get: (key) => {

preactTestmain.tsx1 match

@tmcw•Updated 1 year ago
4 );
5 const html = htm.bind(h);
6 function Component() {
7 const [count, setCount] = useState(0);
8 return html`<div class="foo">${count}</div>`;

newJSJamMessagemain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { jsJamMessages } from "https://esm.town/v/stevekrouse/jsJamMessages";
2
3export function newJSJamMessage(m) {
4 jsJamMessages.push(m);
5 console.email(m, "New message!");

livingmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { alive as alive2 } from "https://esm.town/v/stevekrouse/alive";
3
4export async function living(req: Request) {
5 let name = decodeURI(new URL(req.url).pathname.replace("/", ""));
6 let alive, error;

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