esm.town
esm.town is the home of source code hosted on Val Town. Every val has a corresponding esm.town URL – simply replace val.town
with esm.town
in the URL to get the source code for that val. Vals import code from other vals using their esm.town URL.
For example, https://val.town/v/stevekrouse/demoSDK has its source code available at https://esm.town/v/stevekrouse/demoSDK.
There are a few things to note about esm.town:
- This endpoint will always redirect to a specific version (
?v=15
) if a version isn’t provided initially. - We detect your client - whether it’s a browser, Deno, or something else, and try to serve raw TypeScript source code when the client is able to parse it, and transpiled JavaScript when it can’t. This includes JSX syntax. See our guide on interoperability for more information on using vals in other systems.
- Private vals are accessible on esm.town only by providing a Bearer token.