unjs / giget

✨ Download templates and git repositories with pleasure!
MIT License
425 stars 37 forks source link

How to download `.ts` file #137

Closed productdevbook closed 4 months ago

productdevbook commented 6 months ago

When I try to download ts, you add .json at the end. Why ?

pi0 commented 6 months ago

Hi. This is because we cannot load and execute arbitrary javascript code from sources. JSON is static content that can be fetched and loaded as metadata.

If you need to dynamically generate a registry or source response, you can use a nuxt/nitro server route that responds to the json.