📦 Modules

How modules work in Deno

What is the preferred package registry for Deno projects?

Create your Own ES Modules

Default Export

export default function foo() {
    console.log('foo')
}

Named Export

export function bar() {
    console.log('bar')
}

Import

import foo from "./a.ts";
import { bar } from "./b.ts";

Customizing the Import Names

import customFoo from "./a.ts";
import { bar as customBar } from "./b.ts";

JSR

import { toCamelCase } from "jsr:@std/text"

console.log(toCamelCase('Make me a camel'))

Challenge

const record = { a: "x", b: "y", c: "z" };

Questions? Let's chat

Open Discord