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 🙏

© 2025 – Pkg Stats / Ryan Hefner

microsia

v0.0.7

Published

Blazing fast, minimalist and unopinionated microservices library for nodejs

Downloads

20

Readme

Build Status Codacy Badge Coverage Status Dependency Status

UNDER CONSTRUCTION

This library is under construction, so use at your own risk

Why microsia?

Microsia is an lightweight microservices server with simple, familiar syntax that was inspired by koa and express, allow you to create transport layer for microservices as quick as possible.

Currently, microsia is building around nats as central messaging system. Microsia also has local pubsub system, that allow services on same server communicate with each other fastest without remote messaging system (nats).

Concept:

Concept

Usages:

Install package

npm install --save microsia
# OR
yarn add microsia

Sample service services/bar.js:

const broker = require('microsia')
const service = broker().createService({ name: 'bar' })

service.use(function (ctx, next) {
  console.log('bar was called')
  next()
})

service.subscribe('bar', function(ctx) {
  ctx.res.send({
    msg: `SERVICE bar: Hi, This is bar!`,
  })
})

// Call to other service using current context
// Metadata (requestId,...) will be past to other service, too
service.subscribe('call-to-other', async function(ctx) {
  const res = await ctx.call('baz.status')
  ctx.res.send({
    msg: `SERVICE bar: Status of baz`,
    data: res.body,
  })
})

// Call directly from service will create new context
service.call('foo.foo', {})
    .then(data => console.log(data))

Run group services with service runner:

const loadServices = require('microsia/runner')

// Service path
const services = [
  'services/foo.js',
  'services/bar.js',
]
const options = {
  transporter: {
    name: 'nats',
    options: {
      servers: ['nats://demo.nats.io:4222'],
      timeout: 3000,
      pingInterval: 120000,
      reconnect: true,
      reconnectTimeWait: 2000,
      maxReconnectAttempts: 10,
      maxRequestRetryAttempts: 3,
    },
  },
}

loadServices(options, services)

You also can run only one service directly by node, just pass config to broker() and then run node services/bar.js:

const broker = require('microsia/broker')
const service = broker({
  transporter: {
    name: 'nats',
    options: {
      servers: ['nats://demo.nats.io:4222'],
      timeout: 3000,
      pingInterval: 120000,
      reconnect: true,
      reconnectTimeWait: 2000,
      maxReconnectAttempts: 10,
      maxRequestRetryAttempts: 3,
    },
  },
}).createService({ name: 'bar' })

...

Please see example code in example folder for more information.

Run example code:

Internal Services using runner:

cd example
node index.js

ApiGateway using broker directly and using express as http server:

cd example/gateway
yarn
node index.js

Make request to ApiGateway

curl -i -H "Accept: application/json" "http://localhost:3000/api/bar" 

TODO:

  • Api Gateway
  • Group route
  • Middleware with route
  • Streaming file
  • Circuit Breaker (inside broker)
  • Logger
  • Nats authrorize
  • Serialize (protobuf, ...)
  • Polish code
  • Unit test & code coverage
  • Benchmark
  • Optimize
  • Improve documentation & example
  • Kafka transporter
  • Multi transporter in one broker (consider later)