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=1467&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 19140 results for "function"(2621ms)

getMyValIdmain.tsx1 match

@stevekrouse•Updated 7 months ago
2import ValTown from "npm:@valtown/sdk";
3
4async function getMyValId(importMetaURL: string) {
5 const vt = new ValTown();
6 const { author, name } = extractValInfo(importMetaURL);

getMyValIdREADME.md1 match

@stevekrouse•Updated 7 months ago
1# getMyValId
2
3Helper function for a val to get its own ID.
4
5## Usage

exaltedChocolateHamstermain.tsx1 match

@heettike•Updated 7 months ago
1import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
2
3export default async function scrapeBookMyShow() {
4 const url = "https://in.bookmyshow.com/explore/home/mumbai"; // Example URL, you may need to adjust this
5 const response = await fetch(url, {

handsomeMagentaStoatmain.tsx1 match

@wangqiao1234•Updated 7 months ago
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.

primewiremain.tsx4 matches

@temptemp•Updated 7 months ago
7} from "https://raw.githubusercontent.com/Ciarands/mw-providers/dev/src/providers/sources/primewire/common.ts";
8
9async function search(imdbId: string) {
10 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
11 return await searchResult.json().then((searchResult) => {
14}
15
16async function getStreams(title: string) {
17 const titlePage = load(title);
18 const userData = titlePage("#user-data").attr("v");
53}
54
55export async function scrapeMovie(imdbId) {
56 const searchResult = await search(imdbId);
57
64 };
65}
66export async function scrapeShow(imdbId, seasonId, episodeId) {
67 console.log(imdbId, seasonId, episodeId);
68 if (!imdbId) throw new Error("No imdbId provided");

uptimemain.tsx1 match

@adarshhatkar•Updated 7 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let reason: string, status: number, end: number;
10 let ok = true;

aimain.tsx2 matches

@yawnxyz•Updated 7 months ago
213
214 if (toolResults && toolResults.length > 0) {
215 // we have to do this bc the AI SDK doesn't seem to let you carry over function calling results,
216 // so we pretend to be the user instead of using the official role: tool API, which breaks everything
217 for (const toolResult of toolResults) {
670}
671
672function test() {
673 console.log("test!")
674}

btcPricemain.tsx1 match

@panphora•Updated 7 months ago
4import { fetchJSON } from "https://esm.town/v/panphora/fetchJSON";
5
6export default async function(interval: Interval) {
7 const lastBtcPrice = await blob.getJSON("lastBtcPrice") || 0;
8

apimain.tsx1 match

@romanewmedia•Updated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 // Setup CORS Headers
3 const headers = new Headers();

routineTrackerAppmain.tsx4 matches

@jmt_es•Updated 7 months ago
144};
145
146function App() {
147 const [tareasCompletadas, setTareasCompletadas] = useState([]);
148 const [estadosTemporizador, setEstadosTemporizador] = useState(tareasRutinarias.map(tarea => ({
163 };
164
165 function disparar(proporcionParticulas, opciones) {
166 confetti({
167 ...configuracionPredeterminada,
377}
378
379function client() {
380 createRoot(document.getElementById("root")).render(<App />);
381}
382if (typeof document !== "undefined") { client(); }
383
384async function server(request: Request): Promise<Response> {
385 return new Response(
386 `

getFileEmail4 file matches

@shouser•Updated 2 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
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": "*",