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/$%7Bart_info.art.src%7D?q=function&page=1745&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 18147 results for "function"(4240ms)

countdownmain.tsx1 match

@ion•Updated 1 year ago
1export async function countdown(req: express.Request, res: express.Response) {
2 // Target Time
3 // const target_time = req.params.time ?? ;

valFormmain.tsx4 matches

@rodrigotello•Updated 1 year ago
1export function valForm(functionIWantIntoAForm) {
2 let inputFields = "";
3 for (let i = 0; i < functionIWantIntoAForm.length; i++) {
4 inputFields += `<input type="text" id="input${i}" name="input${i}"><br>`;
5 }
11 <p id="result"></p>
12 <script>
13 document.getElementById('myForm').addEventListener('submit', function(event) {
14 event.preventDefault();
15
17 const args = Array.from(formData.values()).map(Number);
18
19 fetch('https://api.val.town/v1/run/rodrigotello.multiplicationFunctionTest', {
20 method: 'POST',
21 headers: { 'Content-Type': 'application/json' },

peelSessionArtistsmain.tsx1 match

@aeaton•Updated 1 year ago
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
2
3export async function peelSessionArtists(url) {
4 const dom = await fetchHtmlDom(url);
5 const items = dom.querySelectorAll(".link-list > li > a");

pollRSSFeedsmain.tsx1 match

@dosirak•Updated 1 year ago
2import { rssFeeds } from "https://esm.town/v/dosirak/rssFeeds";
3
4export async function pollRSSFeeds({ lastRunAt }) {
5 return Promise.all(
6 Object.entries(rssFeeds).map(async ([name, url]) => {

getReiseauskunftTrainmain.tsx2 matches

@hanbzu•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getReiseauskunftTrain(url) {
4 const { DOMParser } = await import(
5 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
6 );
7 function cleanTime(time) {
8 const cleaned = time
9 .trim()

uniqBymain.tsx1 match

@hanbzu•Updated 1 year ago
1export function uniqBy(array, fn) {
2 const keys = [];
3 return array.filter((item) => {

nummain.tsx1 match

@baj•Updated 1 year ago
1export function num() {
2 if (!this.count)
3 this.count = 1;

myApimain.tsx1 match

@factori•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

githubStarsRSSmain.tsx1 match

@joshmock•Updated 1 year ago
2import { githubStars } from "https://esm.town/v/joshmock/githubStars";
3
4export async function githubStarsRSS(username) {
5 let data = await githubStars(username);
6 return await dataToRSS(data, {

myApimain.tsx1 match

@jonsibley•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

getFileEmail4 file matches

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

tuna8 file matches

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