npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@flexwie/mikro

v0.1.0

Published

True microservices framework for nodeJs

Downloads

1

Readme

@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 heath metrics to the registry in the background. You can then use mikros functions to help with your service. See detailed information below.

EventStream

mikro features an event stream for node communication and alerting.

// 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"
    }
    */
})