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: v4View latest version
If you're running code in Val Town, sometimes you want to know information about the val that's running. This module has functions for that.
import { parseProject } from 'https://esm.town/v/std/utils@71-main/index.ts'
const projectVal = parseProject(import.meta.url)
console.log(projectVal)
The parseProject
function supports URLs with both v
and p
prefixes:
https://esm.town/v/username/project@version-branch/path
https://esm.town/p/username/project@version-branch/path