• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
std

std

utils

Val Town Utilities
Public
Like
4
utils
Home
Code
6
file
1
parseImportMeta
3
serve-file
1
test
2
README.md
index.ts
Branches
3
Pull requests
1
Remixes
7
History
Environment variables
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.
Sign up now
Code
/
parseImportMeta
/
README.md
Code
/
parseImportMeta
/
README.md
Search
5/8/2025
Viewing readonly version of parse-without-version branch: v7
View latest version
README.md

Utilities for parsing import.meta.url

parseProject tests

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.

Usage

Create val
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 two URL formats:

  1. URLs with version and branch: https://esm.town/v/username/name@version-branch/path
  2. URLs without version (latest on main): https://esm.town/v/username/name/path

When using the second format, the function will set version to "latest" and branch to "main".

Prior art

  • @pomdtr/extractValInfo
  • @easrng/whoami
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.