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/$%7BsvgDataUrl%7D?q=function&page=56&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 31520 results for "function"(6883ms)

GlancerrelatedPages.controller.ts1 match

@charmaine•Updated 3 days ago
7});
8
9export async function getRelatedPagesFromDatabase(pageId: string) {
10 try {
11 const response = await notion.databases.query({

GlancerrecordClick.ts1 match

@charmaine•Updated 3 days ago
1export async function recordClick(action: string) {
2 // Create data to store
3 const clickData = {

GlancerREADME.md6 matches

@charmaine•Updated 3 days ago
86```typescript
87// Client-side event recording
88window.recordClick = function (action) {
89 fetch(`/api/setAction`, {
90 method: "POST",
116│ └── index.tsx # Frontend JavaScript entry point
117└── shared/ # Utilities used by both frontend and backend
118 └── utils/ # Shared helper functions
119```
120
129### Shared (`/shared`)
130
131Contains utilities and functions that work in both browser and server environments, ensuring code reusability across the application.
132
133## Framework and Technology Stack
189### Shared Utilities (`/shared`)
190
191Contains helper functions that work in both frontend and backend environments:
192
193```typescript
220
221```typescript
222export default async function (interval: Interval) {
223 const pages = await notion.databases.query({
224 database_id: Deno.env.get("GLANCE_DEMOS_DB_ID"),
280| Aspect | Controller | Utility |
281| ------------ | --------------------------------------------- | ------------------------------------------------- |
282| Purpose | Orchestrates business logic and workflows | Provides small, stateless helper functions |
283| Scope | High-level, involves services or side effects | Low-level, narrow focus (string, date operations) |
284| State | Works with application or user-specific data | Stateless - input in, output out |

GlancerREADME.md1 match

@charmaine•Updated 3 days ago
6| Aspect | **Controller** | **Util** |
7| ----------------- | --------------------------------------------------- | --------------------------------------------------- |
8| **Purpose** | Orchestrates business logic and workflows | Provides small, stateless helper functions |
9| **Scope** | High-level, often involves services or side effects | Low-level, narrow in focus (e.g., string, date ops) |
10| **State** | Works with application or user-specific data | Stateless – input in, output out |

Glancer_README.md4 matches

@charmaine•Updated 3 days ago
7### Task endpoints use /controllers to get and save data
8
9In order to keep the API easy to look and work with, the routes in /tasks handle routing but do not get data from or save data to Notion. The functions that connect to Notion live in the /controllers directory, and are _called_ from the endpoints in /tasks.
10
11### Naming convention for routes and controllers
25 Note that the export in the controller follows the same convention; it's also called `setDemoURL`.
26
271. Once the controller is imported, pass data to the exported function so that it can do its thing:
28
29 ```
31 ```
32
33 Note the function call is the exported function in the import object at the top of the route; i.e., `{ setDemoURL }`. The `setDemoURL.ts` controller exports it like this:
34
35 ```
36 // /controllers/setDemoURL.ts
37 export async function setDemoURL(data: any) {
38 try {
39 ...

Glancer_README.md1 match

@charmaine•Updated 3 days ago
1This directory has crons that extract data from Notion and save that data to blob storage in val.town. Blob storage functions like a cache.
2
3# demoCache.ts

Glancer_README.md2 matches

@charmaine•Updated 3 days ago
1The files in this directory export functions that get data from and save data to Notion. Most of these functions are used by /tasks.
2
3Every controller in this directory includes the Notion client:
20| Aspect | **Controller** | **Util** |
21| ----------------- | --------------------------------------------------- | --------------------------------------------------- |
22| **Purpose** | Orchestrates business logic and workflows | Provides small, stateless helper functions |
23| **Scope** | High-level, often involves services or side effects | Low-level, narrow in focus (e.g., string, date ops) |
24| **State** | Works with application or user-specific data | Stateless – input in, output out |

GlancerpollEnabledStatus.ts1 match

@charmaine•Updated 3 days ago
1export async function pollEnabledStatus() {
2 // this shouldn't run forever just b/c someone forgot to close their browser tab with the demo in it
3 const interval = 1000; // 10000;

GlancerpageID.controller.ts1 match

@charmaine•Updated 3 days ago
6});
7
8export async function setPageID(data: any) {
9 try {
10 const page = await notion.pages.update({

GlancerpageIcon.controller.ts1 match

@charmaine•Updated 3 days ago
6});
7
8export async function setPageIcon(pageId: string, iconURL: string) {
9 try {
10 const page = await notion.pages.update({
tuna

tuna9 file matches

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