# ImportMeta

`import { ImportMeta } from "destack:module";`

Metadata about the current module and build configuration.

```ds title="ImportMeta"
export interface ImportMeta {
    url: string;
    path: string | undefined;
    file: string | undefined;
    filename: string | undefined;
    dir: string | undefined;
    dirname: string | undefined;
    output: "bundle" | "program";
    platform: "unknown" | "windows" | "macos" | "linux" | "freebsd" | "openbsd" | "netbsd" | "dragonfly" | "solaris" | "illumos" | "haiku" | "fuchsia" | "redox" | "hermit" | "none";
    runtime: "destack" | "js";
    target: Dynamic<ImportMetaTarget>;
    targetName: string | undefined;
    product: string | undefined;
    version: string | undefined;
    stage: "experimental" | "alpha" | "beta" | "stable" | undefined;
    derive: readonly Derive[];
    role: string | undefined;
    labels: { readonly [key: string]: readonly string[] | undefined };
    host: "native" | "browser" | "wasi" | "emscripten" | "freestanding";
    modes: readonly string[];
    roles: readonly string[];
    features: readonly string[];
    tags: readonly string[];
    debug: boolean;
    dev: boolean;
    prod: boolean;
    test: boolean;
    bench: boolean;
    lint: boolean;
    env: Dynamic<ImportMetaEnv>;
}
```

[language/library/src/module/meta.ds:64:123](https://github.com/destack-sh/destack/blob/main/language/library/src/module/meta.ds#L64-L123)

## Members

### `url: string`

The URL of the current module (file:// for local, https:// for remote).

### `path: string | undefined`

The file system path of the current module (only for local files).

### `file: string | undefined`

Alias of `path`.

### `filename: string | undefined`

Alias of `file`.

### `dir: string | undefined`

The directory containing the current module (only for local files).

### `dirname: string | undefined`

Alias of `dir`.

### `output: "bundle" | "program"`

The artifact produced by the current build target.

### `platform: "unknown" | "windows" | "macos" | "linux" | "freebsd" | "openbsd" | "netbsd" | "dragonfly" | "solaris" | "illumos" | "haiku" | "fuchsia" | "redox" | "hermit" | "none"`

The target platform (OS) being compiled for.

### `runtime: "destack" | "js"`

The semantic runtime contract for this build.

### `target: Dynamic<ImportMetaTarget>`

Structured target metadata.

### `targetName: string | undefined`

Active build target name.

### `product: string | undefined`

Active deliverable product name.

### `version: string | undefined`

Active package version.

### `stage: "experimental" | "alpha" | "beta" | "stable" | undefined`

Active package release stage.

### `derive: readonly Derive[]`

Auto-derives declared by the current module.

### `role: string | undefined`

Active product role.

### `labels: { readonly [key: string]: readonly string[] | undefined }`

Labels contributed by active source graph conditions.

### `host: "native" | "browser" | "wasi" | "emscripten" | "freestanding"`

Target host environment.

### `modes: readonly string[]`

Active source graph modes.

### `roles: readonly string[]`

Active source graph roles.

### `features: readonly string[]`

Active source graph features.

### `tags: readonly string[]`

Active source graph tags.

### `debug: boolean`

True when the debug mode is active.

### `dev: boolean`

True when the development mode is active.

### `prod: boolean`

True when the production mode is active.

### `test: boolean`

True when the test mode is active.

### `bench: boolean`

True when the benchmark mode is active.

### `lint: boolean`

True when the lint mode is active.

### `env: Dynamic<ImportMetaEnv>`

Environment variables (from build configuration).
