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/$%7Bsuccess?q=function&page=15&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 18175 results for "function"(1237ms)

Towniefavicon.http.tsx1 match

@std•Updated 18 hours ago
3import { TownieIcon } from "./components/icons.tsx";
4
5export default async function (loading: boolean) {
6 const svg = renderToString(
7 <TownieIcon

TownieDebugStyles.tsx1 match

@std•Updated 18 hours ago
4import { Messages } from "./Messages.tsx";
5
6export function DebugStyles () {
7 const [ pathname, setPathname ] = useState("");
8 return (

TownieChatRoute.tsx3 matches

@std•Updated 18 hours ago
15import { Loading } from "./Loading.tsx";
16
17export function ChatRoute () {
18 const { projectId, branchId } = useParams() as {
19 projectId: string;
52}
53
54function Conversation ({
55 project,
56 files,
177}
178
179function shouldRefetch (message) {
180 for (let i = 0; i < message?.parts?.length; i++) {
181 let part = message.parts[i];

TownieBranchSelect.tsx1 match

@std•Updated 18 hours ago
7const NEW_BRANCH_VAL = "__NEW_BRANCH__";
8
9export function BranchSelect () {
10 const { projectId, branchId } = useParams() as {
11 projectId: string;

TownieApp.tsx1 match

@std•Updated 18 hours ago
26});
27
28export function App() {
29 const [audio, setAudio] = useLocalStorage("AUDIO", false);
30 return (

test-blogmarkdown-cheatsheet.md1 match

@charmaine•Updated 18 hours ago
88````markdown
89```javascript
90function example() {
91 console.log("Hello, world!");
92}

asdfasdfasdf.tsx2 matches

@maxm•Updated 18 hours ago
2
3// Generate RSA key pair
4function generateRsaKey() {
5 const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", {
6 modulusLength: 2048,
25
26// Generate EC key pair (P-256 curve)
27function generateEcKey() {
28 const { publicKey, privateKey } = crypto.generateKeyPairSync("ec", {
29 namedCurve: "P-256",

test-blogwelcome-to-my-blog.md1 match

@charmaine•Updated 18 hours ago
38
39```javascript
40function hello() {
41 console.log("Hello, world!");
42}

test-blogpost.html2 matches

@charmaine•Updated 18 hours ago
133 <script>
134 // Format date using date-fns
135 function formatDate(dateString) {
136 try {
137 const date = parseISO(dateString);
143
144 // Render blog post
145 function renderBlogPost() {
146 const postContainer = document.getElementById('blog-post');
147 const post = window.__BLOG_POST__;

test-blogindex.html2 matches

@charmaine•Updated 18 hours ago
42 <script>
43 // Format date using date-fns
44 function formatDate(dateString) {
45 try {
46 const date = parseISO(dateString);
52
53 // Render blog posts
54 function renderBlogPosts() {
55 const postsContainer = document.getElementById('blog-posts');
56 const posts = window.__BLOG_POSTS__ || [];

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": "*",