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=42&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 30800 results for "function"(3132ms)

cardamonqueries.ts5 matches

@connnolly•Updated 2 days ago
3import type { Recipe, Ingredient, RecipeFilters } from "../../shared/types.ts";
4
5export async function createRecipe(recipe: Omit<Recipe, 'id' | 'createdAt' | 'updatedAt'>): Promise<Recipe> {
6 const { ingredients, steps, tags, ...recipeData } = recipe;
7
71}
72
73export async function getRecipeById(id: number): Promise<Recipe | null> {
74 const recipeResult = await sqlite.execute(`
75 SELECT * FROM ${RECIPES_TABLE} WHERE id = ?
114}
115
116export async function getAllRecipes(filters?: RecipeFilters): Promise<Recipe[]> {
117 let query = `SELECT * FROM ${RECIPES_TABLE}`;
118 const params: any[] = [];
158}
159
160export async function updateRecipe(id: number, updates: Partial<Recipe>): Promise<Recipe | null> {
161 const { ingredients, steps, tags, ...recipeData } = updates;
162
221}
222
223export async function deleteRecipe(id: number): Promise<boolean> {
224 const result = await sqlite.execute(`DELETE FROM ${RECIPES_TABLE} WHERE id = ?`, [id]);
225

brokenLinkCrawlermainFunction.tsx1 match

@willthereader•Updated 2 days ago
1import { checkLink } from "./checkLink.tsx";
2import { urlGetter } from "./urlGetter.tsx";
3async function brokenLinkCheckerMainFuction(url) {
4 const urlList = await urlGetter(url);
5 const checkedLink = await Promise.all(urlList.map(checkLink));

brokenLinkCrawlerurlGetter.tsx1 match

@willthereader•Updated 2 days ago
1export async function urlGetter(sourceURl) {
2 const response = await fetch(sourceURl);
3 const html = await response.text();

cardamonRecipeView.tsx1 match

@connnolly•Updated 2 days ago
10}
11
12export default function RecipeView({ recipe, onEdit, onDelete, onBack }: RecipeViewProps) {
13 const [servingMultiplier, setServingMultiplier] = useState(1);
14 const [deleteConfirm, setDeleteConfirm] = useState(false);

cardamonRecipeList.tsx1 match

@connnolly•Updated 2 days ago
11}
12
13export default function RecipeList({
14 recipes,
15 onRecipeSelect,

cardamonApp.tsx1 match

@connnolly•Updated 2 days ago
16}
17
18export default function App() {
19 const [state, setState] = useState<AppState>({
20 view: 'list',

cardamonmigrations.ts1 match

@connnolly•Updated 2 days ago
4const INGREDIENTS_TABLE = 'ingredients_v1';
5
6export async function runMigrations() {
7 console.log('Running database migrations...');
8

zerto-lifecycle-matrixmain.tsx1 match

@captn3m0•Updated 2 days ago
1export default async function (req: Request): Promise<Response> {
2 try {
3 const response = await fetch("https://help-be.zerto.com/api/bundle/Lifecycle.Matrix.HTML/page/product_version_lifecycle_matrix_for_zerto.html");

forward-emails-to-ntfyrailway.ts1 match

@faekiva•Updated 2 days ago
1import { ntfy } from "https://esm.town/v/xkonti/ntfy@v32";
2
3export async function emailValHandler(email: Email) {
4 ntfy
5 .console.log("Email received!", email.from, email.subject, email.text);

invest-trackerstyle_static.tsx1 match

@samxii777•Updated 2 days ago
118
119/* ---------- HTTP response ---------- */
120export default function() {
121 return new Response(css, {
122 headers: { "content-type": "text/css; charset=utf-8" },
tuna

tuna9 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.