Socket
Book a DemoInstallSign in
Socket

mikro

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mikro

True microservices framework for nodeJs

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@flexwie/mikro

npm (scoped) GitHub commit activity Tests

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.

Usage

Install the framework from npm:

npm install --save @flexwie/mikro

Then use it in your microservice like so:

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.

npx @flexwie/mikro new service_name

mikro will automatically send health metrics to the registry in the background. You can then use mikros functions to help with your service. See detailed information on usage in the wiki.

Acknowledgements

This project is inspired by the microservice frameworks micro and gizmo in the golang ecosystem and tries to bring the best parts of those and more to NodeJS.

Keywords

microservices

FAQs

Package last updated on 31 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts