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=522&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 20407 results for "function"(2978ms)

excalidraw-testexcalidraw-in-pages.tsx1 match

@wolf•Updated 3 weeks ago
12);
13
14export default function Page() {
15 return (
16 <>

excalidraw-testvitest.config.mts1 match

@wolf•Updated 3 weeks ago
66 lines: 60,
67 branches: 70,
68 functions: 63,
69 statements: 60,
70 },

excalidraw-testbuildBase.js2 matches

@wolf•Updated 3 weeks ago
20});
21
22function buildDev(config) {
23 return build({
24 ...config,
30}
31
32function buildProd(config) {
33 return build({
34 ...config,

excalidraw-testbuildUtils.js2 matches

@wolf•Updated 3 weeks ago
23});
24
25function buildDev(config) {
26 return build({
27 ...config,
34}
35
36function buildProd(config) {
37 return build({
38 ...config,

excalidraw-testbuildPackage.js2 matches

@wolf•Updated 3 weeks ago
40});
41
42function buildDev(config) {
43 return build({
44 ...config,
50}
51
52function buildProd(config) {
53 return build({
54 ...config,

excalidraw-testindex.html3 matches

@wolf•Updated 3 weeks ago
61 <script>
62 try {
63 function setTheme(theme) {
64 if (theme === "dark") {
65 document.documentElement.classList.add("dark");
69 }
70
71 function getTheme() {
72 const theme = window.localStorage.getItem("excalidraw-theme");
73
146 {
147 const _WebSocket = window.WebSocket;
148 window.WebSocket = function (url) {
149 if (/ws:\/\/localhost:.+?\/sockjs-node/.test(url)) {
150 console.info(

excalidraw-test.env.production1 match

@wolf•Updated 3 weeks ago
3
4VITE_APP_LIBRARY_URL=https://libraries.excalidraw.com
5VITE_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries
6
7VITE_APP_PLUS_LP=https://plus.excalidraw.com

stevensDemotestDailyBrief.ts1 match

@swriddle•Updated 3 weeks ago
4import { DateTime } from "https://esm.sh/luxon@3.4.4";
5
6export async function testDailyBrief() {
7 try {
8 const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");

stevensDemosetupTelegramChatDb.ts1 match

@swriddle•Updated 3 weeks ago
2// Run this script manually to create the database table
3
4export default async function setupTelegramChatDb() {
5 try {
6 // Import SQLite module

stevensDemoREADME.md2 matches

@swriddle•Updated 3 weeks ago
16In a normal server environment, you would likely use a middleware [like this one](https://hono.dev/docs/getting-started/nodejs#serve-static-files) to serve static files. Some frameworks or deployment platforms automatically make any content inside a `public/` folder public.
17
18However in Val Town you need to handle this yourself, and it can be suprisingly difficult to read and serve files in a Val Town Project. This template uses helper functions from [stevekrouse/utils/serve-public](https://www.val.town/x/stevekrouse/utils/branch/main/code/serve-public/README.md), which handle reading project files in a way that will work across branches and forks, automatically transpiles typescript to javascript, and assigns content-types based on the file's extension.
19
20### `index.html`
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors

getFileEmail4 file matches

@shouser•Updated 3 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 3 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.