Repository
Current version released
3 years ago
deno_proxy
Start a proxy server locally to cache Deno resources. The main reason is the current deno land occasionally fails to download.
start server
deno run --allow-net --allow-read --allow-write --allow-env https://deno.land/x/deno_proxy@v0.0.3/mod.ts
Then your server will be started on http://localhost
. You can use like this:
import { VERSION } from "http://localhost/https/deno.land/std@0.140.0/version.ts";
console.log(VERSION);
It just changed your origin URL https://deno.land
to
http://localhost/https/deno.land
.
use cli to generate import_map.json
If your import_map.json
like this:
{
"imports": {
"/std/": "https://deno.land/std@0.140.0/"
}
}
Then generate your proxy import_map.json
by the above:
deno run --allow-read --allow-write https://deno.land/x/deno_proxy@v0.0.3/cli/mod.ts --baseUrl http://localhost:8000 --oldPath example/import_map.json --newPath example/import_map_proxy.json
The import_map_proxy.json
should be this:
{
"imports": {
"/std/": "http://localhost:8000/https/deno.land/std@0.140.0/"
}
}
Then you can run your code:
deno run -A --import-map ./example/import_map_proxy.json ./example/mod.ts
See here for more information.