mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
d5dd5ae87d
Add std/version.ts and document unstableness of std.
788 B
788 B
Import maps
This is an unstable feature. Learn more about unstable features.
Deno supports import maps.
You can use import map with the --importmap=<FILE>
CLI flag.
Current limitations:
- single import map
- no fallback URLs
- Deno does not support
std:
namespace - supports only
file:
,http:
andhttps:
schemes
Example:
// import_map.json
{
"imports": {
"http/": "https://deno.land/std/http/"
}
}
// hello_server.ts
import { serve } from "http/server.ts";
const body = new TextEncoder().encode("Hello World\n");
for await (const req of serve(":8000")) {
req.respond({ body });
}
$ deno run --importmap=import_map.json --unstable hello_server.ts