# @tsdoc-test-reporter/core

> @tsdoc-test-reporter/core contains the main logic for parsing comment tags from a TypeScript file. It requires a TypeScript `SourceFile` and the `TSDocParser` from `@microsoft/tsdoc`.

Latest version **0.0.33** (published 2024-08-31) · 0 weekly downloads

## Install

```sh
npm install @tsdoc-test-reporter/core
pnpm add @tsdoc-test-reporter/core
yarn add @tsdoc-test-reporter/core
bun add @tsdoc-test-reporter/core
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.33 |
| Published | 2024-08-31 |
| First published | 2023-10-08 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 197.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jesperorb |

## Links

- npm: https://www.npmjs.com/package/@tsdoc-test-reporter/core
- npm.io page: https://npm.io/package/@tsdoc-test-reporter/core

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0
- [@microsoft/tsdoc](https://npm.io/package/@microsoft/tsdoc.md) ^0.14.2

## Recent versions

- 0.0.33 (latest) — 2024-08-31
- 0.0.32 — 2024-04-27
- 0.0.31 — 2024-03-02
- 0.0.30 — 2024-02-10
- 0.0.29 — 2023-11-01
- 0.0.28 — 2023-11-01
- 0.0.27 — 2023-10-31
- 0.0.26 — 2023-10-30
- 0.0.25 — 2023-10-29
- 0.0.24 — 2023-10-29
- 0.0.23 — 2023-10-29
- 0.0.22 — 2023-10-29
- 0.0.20 — 2023-10-28
- 0.0.18 — 2023-10-27
- 0.0.17 — 2023-10-26
- … 14 more at https://npm.io/package/@tsdoc-test-reporter/core/versions

## README

# @tsdoc-test-reporter/core

@tsdoc-test-reporter/core contains the main logic for parsing comment tags from a TypeScript file. It requires a TypeScript `SourceFile` and the `TSDocParser` from `@microsoft/tsdoc`.

## Installing

```bash
npm install @tsdoc-test-reporter/core
```

## Testing

```bash
pnpm nx test core
```

## Minimal required setup

Below is a the minimal required setup to be able to parse a source file. You will need to load the source files yourself similar to the example.

```ts
import { TSDocParser } from '@microsoft/tsdoc';

import { CompilerOptions, createProgram, ScriptTarget, SourceFile } from 'typescript';

const program = createProgram(['myFileName.ts'], { target: ScriptTarget.Latest });

const sourceFile = program.getSourceFile('myFileName.ts');

const { testBlockDocComments } = new CommentTagParser({
	sourceFile,
	tsDocParser: new TSDocParser(),
});
```

## Custom tags

Example for parsing test files where you have custom TSDoc tags.

```ts
import {
	TSDocConfiguration,
	TSDocParser,
	TSDocTagDefinition,
	TSDocTagSyntaxKind,
} from '@microsoft/tsdoc';

import { CompilerOptions, createProgram, ScriptTarget, SourceFile } from 'typescript';

const program = createProgram(['myFileName.ts'], { target: ScriptTarget.Latest });

const sourceFile = program.getSourceFile('myFileName.ts');

const config = new TSDocConfiguration();
const customBlockDefinition = new TSDocTagDefinition({
	tagName: '@custom',
	syntaxKind: TSDocTagSyntaxKind.BlockTag,
});
config.addTagDefinition(customBlockDefinition);

const { testBlockDocComments } = new CommentTagParser<'@custom'>({
	sourceFile,
	tsDocParser: new TSDocParser(config),
});
```

---
_Source: https://npm.io/package/@tsdoc-test-reporter/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
