Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_graph/lib/types.d.ts>Module

The module graph logic for Deno CLI
Go to Latest
class Module
import { Module } from "https://deno.land/x/deno_graph@0.38.0/lib/types.d.ts";

Constructors

new
private
Module()

Properties

readonly
optional
cacheInfo: CacheInfo

Any cache information that was available on the module when the graph was built.

readonly
optional
checksum: string

The calculated checksum of the source of the module if available when the graph was built.

readonly
optional
dependencies: Record<string, Dependency>

A record of the dependencies, where the key is the string specifier of the dependency and the value is the dependency object.

readonly
kind: ModuleKind

A module kind that can be used to determine how a module should be loaded at runtime.

readonly
mediaType: MediaType

The media type assigned to the module. This determines how Deno will handle the module.

readonly
size: number

The size of the source content in bytes.

readonly
source: string

The source content of the module.

readonly
specifier: string

The fully qualified string URL of the module.

readonly
optional
typesDependency: [string, ResolvedDependency]

The types dependency for the module, where the first value in the tuple was the string specifier used and the second value is the resolved dependency.

Methods

free(): void

Explicitly free the memory used by the module.

Returns a plain-object representation of the module suitable for serialization as JSON.