# getTransport() function · @imqueue/async-logger

Source: https://imqueue.org/api/async-logger/latest/async-logger.gettransport/
Published: 2026-07-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/async-logger 3.2.0 — generated reference, not hand-written

Constructs a winston transport of the named type.

**Signature:**

```typescript
export declare function getTransport(type: string, options: FileTransportOptions | HttpTransportOptions): Transport;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| type | string | `'file'` or `'http'` |
| options | FileTransportOptions \| HttpTransportOptions | options for the winston transport constructor |


**Returns:**

Transport

the transport, or nothing if the type is not recognised

## Remarks

Only `'file'` and `'http'` are supported. Anything else returns nothing — despite the declared return type, which is a `Transport` cast rather than a guarantee. [Logger](https://imqueue.org/api/async-logger/latest/async-logger.logger/) checks for that and reports the offending type; a direct caller must check too.

