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

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

## Parameters

| Parameter | Type |
| :------ | :------ |
| `source` | `string` \| [`SourceFile`](Interface.SourceFile.md) |
| `diagnosticHandler` | [`DiagnosticHandler`](Type.DiagnosticHandler.md) |

## Returns

[`Scanner`](Interface.Scanner.md)
