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=657&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 8248 results for "function"(437ms)

HTTP101templateWebsite1 match

@willthereader•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 `

HTTP101GETrequestFormExample1 match

@willthereader•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 `

HTTP101logicalJadeCow1 match

@willthereader•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 `

HTTP101getDataTransfer1 match

@willthereader•Updated 1 month ago
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method === "get") {
5 // Extract form data from the POST request.

HTTP101AIcode1 match

@willthereader•Updated 1 month ago
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method === "POST") {
5 // Extract form data from the POST request.

HONCindex.ts1 match

@charmaine•Updated 1 month ago
65 * and then call the Hono api entrypoint (`app.fetch`)
66 */
67export default async function(req: Request): Promise<Response> {
68 const env = Deno.env.toObject();
69 // NOTE - Adding the entire env object will also expose the following values to your api handlers:

blahblah3 matches

@ajax•Updated 1 month ago
1export default async function server(request: Request): Promise<Response> {
2 const agents = [
3 {
11 type: "string",
12 description: `Based off the users request you are going to write perfect,
13 pure typescript, and return an extremely functional code block, that will be run in cloud functions by valtown.`,
14 },
15 tool_name: {
16 type: "string",
17 description: "The name of the tool/function",
18 },
19 },

exclusiveGoldArmadilloREADME.md2 matches

@charmaine•Updated 1 month ago
46- Key: `mentionsDiscord`
47- Value: Your Discord webhook URL.
48Notifications will be sent using this function:
49
50```ts
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

exclusiveGoldArmadillomain.tsx1 match

@charmaine•Updated 1 month ago
12const isProd = false;
13
14export async function twitterAlert({ lastRunAt }: Interval) {
15 // If isProd, search for tweets since that last time this interval ran
16 // if not, search for tweets since 48 hours ago for testing

GitHubSyncvaltown-deploy6 matches

@davincidreams•Updated 1 month ago
17////
18
19export default async function valTownDeploy(c: Context) {
20 console.log("deploy to valtown");
21 const body = await c.req.json();
45}
46
47async function getContents(repo: Repo, after: string, commits: Commit[]) {
48 const filenames = config.vals.map((name: string) => name + ".tsx");
49 console.log(`${filenames.length} val files updated`);
55}
56
57function getModified(commits: Commit[], filenames: string[]) {
58 return commits.reduce((a: string[], b: Commit) => {
59 return [...a, ...b.modified];
61}
62
63function getFileContent(repo: Repo, after: string) {
64 return async (path: string): Promise<{
65 name: string;
81}
82
83async function updateVals(user: ValUser, updates: { name: string; code: string; }[]) {
84 console.log("updateVals");
85 await Promise.all(updates.map(async (update) => {
88}
89
90async function updateVal(username: string, update: { name: string; code: string; }) {
91 const { name, code } = update;
92 const val = await valtown.alias.username.valName.retrieve(username, name);

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago