Edit

Import maps

Deno supports import maps.

You can use import maps with the --import-map=<FILE> CLI flag.

Example:

import_map.json

{
   "imports": {
      "fmt/": "https://deno.land/std@0.91.0/fmt/"
   }
}

color.ts

import { red } from "fmt/colors.ts";

console.log(red("hello world"));

Then:

$ deno run --import-map=import_map.json color.ts

To use starting directory for absolute imports:

import_map.json

{
  "imports": {
    "/": "./"
  }
}

main.ts

import { MyUtil } from "/util.ts";

You may map a different directory: (eg. src)

import_map.json

{
  "imports": {
    "/": "./src/"
  }
}