Managing dependencies

    • Deno uses URLs for dependency management.
    • One convention places all these dependent URLs into a local file. Functionality is then exported out of deps.ts for use by local modules.
    • Continuing this convention, dev only dependencies can be kept in a dev_deps.ts file.
    • See also Linking to external code
    1. /**
    2. */
    3. import { add, multiply } from "./deps.ts";
    4. function totalCost(outbound: number, inbound: number, tax: number): number {
    5. return multiply(add(outbound, inbound), tax);
    6. console.log(totalCost(45, 27, 1.15));
    7. /**
    8. * Output
    9. *
    10. * 60
    11. */