jsr
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
This service enables quick generation of new val with specified jsr package. Package authors can provide custom examples by setting either:
valtownExample
property ofjsr.json
/deno.json
to contain example js/ts codevaltownExampleFilename
property ofjsr.json
/deno.json
to point to the file with example js/ts code
If no example is found val will be created with the default snippet, using @luca/flag
as an example :
Go ahead ↗️ try it (on Val Town)! 🎉
Additionally, the service supports ?code=<base64code>
query param that allows overriding extracted/generated example code.
For example one might want to override @luca/flag
's snippet with:
In order to do so first you need to convert it to base64:
$ printf 'import { printProgress } from "jsr:@luca/flag@1";\n\nprintProgress();' | base64 -w0 # ==> aW1wb3J0IHsgcHJpbnRQcm9ncmVzcyB9IGZyb20gImpzcjpAbHVjYS9mbGFnQDEiOwoKcHJpbnRQcm9ncmVzcygpOw==
Then you simply construct the URL by setting the returned value to code
query param:
↗️ https://vladimyr-jsr.web.val.run?code=aW1wb3J0IHsgcH...
https://vladimyr-jsr.web.val.run/<scope>/<name>[@<version>]
https://vladimyr-jsr.web.val.run?code=<base64code>
- https://vladimyr-jsr.web.val.run/@luca/flag
- https://vladimyr-jsr.web.val.run/@std/assert@0.220.1
- https://vladimyr-jsr.web.val.run/@mark/html@latest
Migrated from folder: jsr/jsr