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/$%7Burl%7D?q=function&page=2102&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 22081 results for "function"(2096ms)

nftmain.tsx1 match

@vawogbemi•Updated 1 year ago
1export function nft(name, description, image) {
2 return {
3 "name": name,

myApimain.tsx1 match

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

inspoHTMLmain.tsx1 match

@rodrigotello•Updated 1 year ago
1import { valTownInspoList } from "https://esm.town/v/rodrigotello/valTownInspoList";
2
3export function inspoHTML(req, res) {
4 res.send(
5 valTownInspoList.map((d) => `

FigmaFrameObjectToHTMLmain.tsx5 matches

@rodrigotello•Updated 1 year ago
1export function FigmaFrameObjectToHTML(json) {
2 const sansSerifFonts = new Set([
3 "Arial",
24 "serif",
25 ]);
26 function convertRgbToHex(rgb) {
27 return ((rgb * 255) | (1 << 8)).toString(16).slice(1);
28 }
29 function generateColor(cssColorObject) {
30 return `#${
31 Object.values(cssColorObject)
34 }`;
35 }
36 function generateStyles(json) {
37 let style = "";
38 if (json.backgroundColor) {
89 return style;
90 }
91 function convertToHtml(json, level = 0) {
92 if (level > 10) {
93 return ""; // Prevent excessive recursion

convertRGBToHexmain.tsx1 match

@rodrigotello•Updated 1 year ago
1export function convertRGBToHex(rgb) {
2 return ((rgb * 255) | (1 << 8)).toString(16).slice(1);
3}

fetchGHRepoInfomain.tsx1 match

@noartem•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchGHRepoInfo(userName, repoName) {
4 const response = await fetch(`https://ungh.cc/repos/${userName}/${repoName}`);
5 return await response.json();

stub_user_storage_responsemain.tsx1 match

@seanttaylor•Updated 1 year ago
1export function stub_user_storage_response() {
2 return {
3 "hash": "e218fc4c0fec64514e13870a081687f239843df40142cb0f104dec3f3c5682a1",

GenerateQRmain.tsx1 match

@ramkarthik•Updated 1 year ago
1// fetch("https://api.val.town/v1/express/ramkarthik.GenerateQR?url={url}"
2export async function GenerateQR(req, res) {
3 const url = req.query.url;
4 res.set("Content-Type", "text/html");

domainAvailabilitymain.tsx1 match

@ramkarthik•Updated 1 year ago
1export async function domainAvailability(req, res) {
2 const whoiser = await import("npm:whoiser");
3 var domain = req.body;

untitledTWmain.tsx1 match

@joshmock•Updated 1 year ago
2let { tw } = await import("https://esm.town/v/joshmock/tw");
3
4export async function untitledTW(params) {
5 if (params && params.val) {
6 tw = params.val;

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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.