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=2555&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 28949 results for "function"(1945ms)

31the simplest way to achieve the goal, though you can add some inline comments to explain your
32reasoning (not for every line, but for major groups of lines). Don't use any environment variables
33unless strictly necessary, for example use APIs that don't require a key, prefer internal function
34imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
35functions where possible. Unless specified, don't add error handling,
36make sure that errors bubble up to the caller.
37There should be no comments like "more content here", it should be complete and directly runnable.
38The val should create a "export default async function main() {" which
39is the main function that gets executed, without any arguments. Don't return a Response object,
40just return a plain Javascript object, array, or string.
41`.replace("\n", " ");
42
43// Your response should start with \`\`\`ts and end with \`\`\`.
44// The val should create a "export default async function main() {" which
45// is the main function that gets executed, without any arguments. Don't return a Response object,
46// just return a plain Javascript object, array, or string.
47
84 const writer = writable.getWriter();
85 const textEncoder = new TextEncoder();
86 function write(text) {
87 writer.write(textEncoder.encode(text));
88 }
152 </div>
153 <script>
154 function updateValName(valName) {
155 const valUrl = valName ? \`https://val.town/v/${username}/\${valName}\` : "";
156 const previewUrl = valName ? \`https://${username}-\${valName}.web.val.run\` : "";
160 document.getElementById('open-link').href = previewUrl;
161 }
162 function saveVal() {
163 if (window.codeMirrorEditor) {
164 document.getElementById("save-icon").classList.remove("hidden");
180 return false;
181 })
182 function openTab(tab) {
183 const tabButtonCode = document.getElementById("tab-button-code");
184 const tabButtonPreview = document.getElementById("tab-button-preview");
200 }
201 }
202 function toggleTab() {
203 openTab(document.getElementById("tab-panel-code").style.visibility === "visible" ? "preview" : "code");
204 }
258 (() => {
259 const scrollingElement = document.getElementById("conversation-container");
260 const callback = function (mutationsList, observer) {
261 scrollingElement.scrollTo({ left: 0, top: scrollingElement.scrollHeight, behavior: "instant" });
262 };
331 window.setCodeMirrorContent({ doc: '', old: ''});
332 let fullStr = "";
333 window.addToken = function(str) {
334 fullStr += str;
335 const code = fullStr.replaceAll("\`\`\`ts\\n", "").replaceAll("\`\`\`", "");
31the simplest way to achieve the goal, though you can add some inline comments to explain your
32reasoning (not for every line, but for major groups of lines). Don't use any environment variables
33unless strictly necessary, for example use APIs that don't require a key, prefer internal function
34imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
35functions where possible. Unless specified, don't add error handling,
36make sure that errors bubble up to the caller.
37There should be no comments like "more content here", it should be complete and directly runnable.
38The val should create a "export default async function main" which is the main function that gets
39executed on every HTTP request.
40`.replace("\n", " ");
41
42// Your response should start with \`\`\`ts and end with \`\`\`.
43// The val should create a "export default async function main() {" which
44// is the main function that gets executed, without any arguments. Don't return a Response object,
45// just return a plain Javascript object, array, or string.
46
83 const writer = writable.getWriter();
84 const textEncoder = new TextEncoder();
85 function write(text) {
86 writer.write(textEncoder.encode(text));
87 }
150 </div>
151 <script>
152 function updateValName(valName) {
153 const valUrl = valName ? \`https://val.town/v/${username}/\${valName}\` : "";
154 const previewUrl = valName ? \`https://${username}-\${valName}.web.val.run\` : "";
158 document.getElementById('open-link').href = previewUrl;
159 }
160 function saveVal() {
161 if (window.codeMirrorEditor) {
162 document.getElementById("save-icon").classList.remove("hidden");
178 return false;
179 })
180 function openTab(tab) {
181 const tabButtonCode = document.getElementById("tab-button-code");
182 const tabButtonPreview = document.getElementById("tab-button-preview");
198 }
199 }
200 function toggleTab() {
201 openTab(document.getElementById("tab-panel-code").style.visibility === "visible" ? "preview" : "code");
202 }
256 (() => {
257 const scrollingElement = document.getElementById("conversation-container");
258 const callback = function (mutationsList, observer) {
259 scrollingElement.scrollTo({ left: 0, top: scrollingElement.scrollHeight, behavior: "instant" });
260 };
329 window.setCodeMirrorContent({ doc: '', old: ''});
330 let fullStr = "";
331 window.addToken = function(str) {
332 fullStr += str;
333 const code = fullStr.replaceAll("\`\`\`ts\\n", "").replaceAll("\`\`\`", "");
2// This val will respond with a HTML page styled with fun CSS
3
4export default async function main(): Promise<Response> {
5 const htmlContent = `
6 <!DOCTYPE html>
1// This val will respond with a HTML page styled with fun CSS
2
3export default async function main(): Promise<Response> {
4 const htmlContent = `
5 <!DOCTYPE html>
1// This val will respond with a fun HTML page with crazy fonts and gradients
2
3export default async function main(): Promise<Response> {
4 const htmlContent = `
5 <!DOCTYPE html>
1// This val will respond with a styled HTML page with fun CSS
2
3export default async function main(): Promise<Response> {
4 const htmlContent = `
5 <!DOCTYPE html>
1// This val will respond with a fun HTML page with crazy fonts and gradients
2
3export default async function main(): Promise<Response> {
4 const htmlContent = `
5 <!DOCTYPE html>
1// This val will respond with a simple HTML page with fun CSS styles like crazy fonts and gradients
2
3export default async function main(): Promise<Response> {
4 const htmlContent = `
5 <!DOCTYPE html>
1// This val will respond with an HTML page saying "Hello, world!" with fun CSS.
2
3export default async function main(): Promise<Response> {
4 const htmlContent = `
5 <!DOCTYPE html>
1// This val will respond with an HTML page saying "Hello, world!" with fun CSS styles.
2
3export default async function main(): Promise<Response> {
4 const htmlContent = `
5 <!DOCTYPE html>
tuna

tuna9 file matches

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