Skip to content

Commit

Permalink
docs: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jul 7, 2022
1 parent 879faca commit 7e6fcfa
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# event-transmitter
Async adapter to save & deliver reasonable events to some endpoint
# @qiwi/event-transmitter
> Async adapter to save & deliver reasonable events to some endpoint
[![CI](https://github.com/qiwi/event-transmitter/workflows/CI/badge.svg)](https://github.com/qiwi/event-transmitter/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/d72d92ed2e931dacecf9/maintainability)](https://codeclimate.com/github/qiwi/event-transmitter/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/d72d92ed2e931dacecf9/test_coverage)](https://codeclimate.com/github/qiwi/event-transmitter/test_coverage)

## Install
```bash
yarn add @qiwi/event-transmitter
```

## Usage
```typescript
import { createFrontLogProxyTransmitter } from '@qiwi/event-transmitter'
const transmitter = createFrontLogProxyTransmitter({
appName: 'my-app',
url: 'https://example.qiwi.com/event'
})

transmitter.error(new Error('some error'))
transmitter.info('some-event')
transmitter.debug('debug')
transmitter.warn('warn')
transmitter.trace('trace')
```

```typescript
```ts
import {createTransmitter, createHttpPipe, IPipe} from '@qiwi/event-transmitter'

const httpPipe: IPipe = createFetchPusher({
Expand All @@ -35,3 +25,24 @@ const event: IClientEventDto = {...}

transmitter.push(event)
```

### FLP integration
```ts
import { createFrontLogProxyTransmitter } from '@qiwi/event-transmitter'

const transmitter = createFrontLogProxyTransmitter({
appName: 'my-app',
url: 'https://example.qiwi.com/event'
})

// logger-like interface
transmitter.error(new Error('some error'))
transmitter.info('some-event')
transmitter.debug('debug')
transmitter.warn('warn')
transmitter.trace('trace')
```
See also [https://github.com/qiwi/flp-njs](https://github.com/qiwi/flp-njs)

## License
[MIT](LICENSE)

0 comments on commit 7e6fcfa

Please sign in to comment.