# runtime/entrypoints/index.entrypoint.ts

> 21 lines of code and 2 definitions.

Tree: GovLab Docs
Language: typescript
Layer: runtime
Canonical: https://banes-lab.com/anatomy/docs#file-docs-runtime-entrypoints-index-entrypoint-ts
Source text: https://banes-lab.com/source/docs/runtime/entrypoints/index.entrypoint.ts.txt

Listed in [runtime/entrypoints](https://banes-lab.com/api/source/docs/runtime/entrypoints.md), after [runtime/entrypoints/document.entrypoint.ts](https://banes-lab.com/source/docs/runtime/entrypoints/document.entrypoint.ts.md) and before [runtime/entrypoints/invocation.entrypoint.ts](https://banes-lab.com/source/docs/runtime/entrypoints/invocation.entrypoint.ts.md).

## Definitions

- `targetOf` (lexical_declaration, line 10)
- `argv` (lexical_declaration, line 14)

## Contained in

- [runtime/entrypoints](https://banes-lab.com/anatomy/docs/folder-docs-runtime-entrypoints.md)

## Source

```typescript
import { FAILURE_EXIT, FLAG_NAMES } from "#configuration/constants/invocation.constants";
import { absolutePath, relativePath } from "@ssot/paths";
import { hasFlag, resolveArgv } from "@govlab/argv";
import { INDEX_ARGV } from "#configuration/configs/invocation.config";
import type { OutputTarget } from "#types/document.output.types";
import { printErr } from "#core/reporters/base.reporter";
import process from "node:process";
import { runIndex } from "#core/coordinators/index.coordinator";

const targetOf = function targetOf(key: string): OutputTarget {
    return { path: absolutePath(key), rel: relativePath(key) };
};

const argv = resolveArgv(INDEX_ARGV);

try {
    await runIndex(hasFlag(argv, FLAG_NAMES.check), {
        json: targetOf("projectInfo.index.json"),
        markdown: targetOf("projectInfo.index.markdown"),
    });
} catch (error) {
    printErr(error instanceof Error ? error.message : String(error));
    process.exitCode = FAILURE_EXIT;
}
```
