utils
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v25View latest version
Instructions: After EVERY checkbox, test that it works by visiting the HTTP endpoint URL (look it up via Val Town MCP). Mark ✅ by editing this file in Val Town only after confirming it works.
- Remove from README.md all the functions documented in _tests.ts (look up endpoint URL via MCP)
- Add JSDoc to
serveFile→ Test: appears in docs, remove from README.md - Add JSDoc to
getContentType→ Test: appears in docs, remove from README.md - Add JSDoc to
parseVal→ Test: appears in docs, remove from README.md - Add JSDoc to
isMain→ Test: appears in docs, remove from README.md - Add JSDoc to
testServer→ Test: appears in docs, remove from README.md - Add JSDoc to
fetchTranspiledJavaScript→ Test: appears in docs, remove from README.md - Add JSDoc to
staticHTTPServer→ Test: appears in docs, remove from README.md - Are there any functions left documented in README.md? If so, add them to this list and move them to JSDoc
- Add target="top" to all links to "val.town"
- Fix the
readFiletype to take two strings and return a Promise of string or undefined. - Add js syntax highlighting for the function signature and the example.
Strip the
tsfrom the example - Add precise type information for all inputs and outputs. Users should know exactly every field of every input and every output type.
- Improve the placement of the view source link - it should be directly under the function's name header. It should just say "view source"
- The view source link should link to the whole function range, not just the first line.
- Linkify all the function names with hash-based id links
- Add a left panel sidebar table of contents thing, organized by category, inspired by lodash
- At the top of the docs, link to the utils val
- At the top of the docs, explain the purpose of these vals
- In the read, list file vals, explain how val town doesn't have file access so it can more cheaply and scalably provide a serverless runtime, but you can use these utils which read your val files via the val town api
- Consider linking to all test for each function near its documentation
