---
jsApi: true
title: "[F] createScanner"

---
```ts
createScanner(source, diagnosticHandler): Scanner
```

## Parameters

| Parameter | Type |
| :------ | :------ |
| `source` | `string` \| [`SourceFile`](../interfaces/SourceFile.md) |
| `diagnosticHandler` | [`DiagnosticHandler`](../type-aliases/DiagnosticHandler.md) |

## Returns

[`Scanner`](../interfaces/Scanner.md)
