# @flexwie/mikro

> True microservices framework for nodeJs

Latest version **0.1.0** (published 2020-12-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install @flexwie/mikro
pnpm add @flexwie/mikro
yarn add @flexwie/mikro
bun add @flexwie/mikro
```

Provides the command `mikro`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-12-19 |
| First published | 2020-12-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 30.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Felix Wieland |
| Maintainers | flexwie |
| Keywords | microservices, framework, cli, distributed |

## Links

- npm: https://www.npmjs.com/package/@flexwie/mikro
- Repository: https://github.com/flexwie/mikro
- Homepage: https://github.com/flexwie/mikro#readme
- Issues: https://github.com/flexwie/mikro/issues
- npm.io page: https://npm.io/package/@flexwie/mikro

## Dependencies (4)

- [ioredis](https://npm.io/package/ioredis.md) ^4.19.4
- [kafkajs](https://npm.io/package/kafkajs.md) ^1.15.0
- [winston](https://npm.io/package/winston.md) ^3.3.3
- [unique-names-generator](https://npm.io/package/unique-names-generator.md) ^4.3.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2020-12-19
- 0.0.2-alpha.7.0 — 2020-12-19
- 0.0.2-alpha.6.0 — 2020-12-19
- 0.0.2-alpha.5.0 — 2020-12-19
- 0.0.2-alpha.4.0 — 2020-12-19
- 0.0.2-alpha.3.0 — 2020-12-19
- 0.0.2-alpha.2.0 — 2020-12-19
- 0.0.2-alpha.1.0 — 2020-12-19
- 0.0.1 — 2020-12-16

## README

# @flexwie/mikro

![npm (scoped)](https://img.shields.io/npm/v/@flexwie/mikro)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/flexwie/mikro)
![Tests](https://github.com/fosscom/mikro/workflows/Tests/badge.svg)

`mikro` aims to simplify developing microservices on nodejs by taking away the need to configure infrastructure. Simply write services with the framework and deploy them by ejecting the infrastructure for use with Docker or K8s. Read more on how to deploy `mikro` at [Deployment](#deployment).

## Usage
Install the framework from npm:
```sh
npm install --save @flexwie/mikro
```

Then use it in your microservice like so:
```javascript
const { Mikro } = require('@flexwie/mikro')

/*
create a new instance and configure it (optional)
first parameter is the name of your service, second are options for your environement
*/
const mikro = new Mikro('example', {
    redis: {        // redis connection details
        host: 'localhost',
        port: 6379,
        db: 0
    }
})

// ... your microservice code here

// register your new service with the registry
mikro.register()

```

You can use the included CLI to quickly create a boilerplate. For more information see the [CLI Readme](/cli).

```
npx @flexwie/mikro new service_name
```

`mikro` will automatically send heath metrics to the registry in the background. You can then use `mikro`s functions to help with your service. See detailed information below.

### EventStream
`mikro` features an event stream for node communication and alerting.

```javascript
// publish an event
mikro.events.publish("testevent", {data: "test"})

// add a new subscriber to an event
mikro.events.subscribe("testevent", (err, data) => {
    console.log(data)
    /*
    {
        emitterName: "automatically-generated-name",
        timestamp: 123456789,
        data: "test"
    }
    */
})
```

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