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 🙏

© 2026 – Pkg Stats / Ryan Hefner

microsquad

v0.1.0

Published

> Быстрый минималистичный фреймворк для создания распределенных сервисов на [node](https://nodejs.org)

Downloads

16

Readme

Быстрый минималистичный фреймворк для создания распределенных сервисов на node

microservice

[cool-badles-list]

npm install microservice
const { Service } = require('microservice')
const service = new Service({ name: 'test-service', version: '0.0.1' })

await service.init()
await service.add('test-task', () => 'success')

// subscribe to task execution result (event-driven behavour)
await service.subscribe('test-task',
  output => console.log(output)) // "success"

// run local task using load-balancer between distributed service instances
const result = await service.run('test-task')
console.log(result) // "success"

// run remote task using transport service autodiscovery
const result2 = await service.request({ service: 'test-service', task: 'test-task' })
console.log(result2) // "success"

Features

  • promise-based
  • single interaction interface between services mesh
  • ability to create services using most suitable transport
  • versioning support
  • different modes: event-sourcing, command pattern
  • features support: load balancing, services autodiscovery, request routing, fault injection, encryption {depens on the choosen transport}
  • internal metrics, automati service map, request profiling {not yet implemented}

API

Init service instance

.init() => Promise(serviceInstance)

Происходит подключение указаных транспортов, настройка соединений и т.п. Данная операция должна быть выполнена при старте каждого сервиса.

const { Service } = require(''microservice'')
const service = new Service(options)
await service.init()

options:

| Name | Description | Format | | ------ | ------ | ------ | | name | Required. Readable service name. | string: ^[a-z0-9-_]+$ | | version | Required. Service version. | string: semver | | transports | Required. List of supported transports and their settings. Default: [{"name":"local","type":"local","default":true}] | array | | routes | Routing table for external requests (in case if transport does not support routing). | object | | timeout | Default task timeout in ms. | number | | slow | Emit "slow" event after specified delay in ms. | number | | local | Do not emit task events globally. Default: false | boolean |

Add new service task

.add(task, method) => Promise()

.add(options | taskName, method) => Promise()

| Name | Description | Format | | ------ | ------ | ------ | | task | Required. undefined | string: ^[a-z0-9-_.]+$ | | version | | string: version |

Run local task with distributed load-balancing environment

.run(task, ...arguments) => Promise(result)

.run(options, ...arguments) => Promise(result)

This task will be launched by the most suitable service instace. Other services can .subscribe to the execution result.

| Name | Description | Format | | ------ | ------ | ------ | | task | Required. undefined | string: ^[a-z0-9-_.]+$ | | local | undefined Default: false | boolean | | skipEvent | undefined Default: false | boolean | | timeout | | number | | slow | | number |

Run task from remote service.

.request(service, task, ...arguments) => Promise(result)

.request(options, ...arguments) => Promise(result)

| Name | Description | Format | | ------ | ------ | ------ | | task | Required. undefined | string: ^[a-z0-9-.]+$ | | service | Required. undefined | string: ^[a-z0-9-]+$ | | timeout | | number | | slow | | number | | services | | array |

Subscribe to task execution result.

.subscribe(eventHandler) => Promise()

.subscribe(task, eventHandler) => Promise()

.subscribe(task, service, eventHandler) => Promise()

.subscribe(options, eventHandler) => Promise()

| Name | Description | Format | | ------ | ------ | ------ | | task | | string: ^[a-z0-9-.]+$ | | source | | string: ^[a-z0-9-]+$ | | match | | object |

events

slow

Transports

| Name | Description | Format | | ------ | ------ | ------ | | name | Required. Transport name. | string: ^[a-z0-9-]+$ | | type | Required. Transport driver name. | string: ^[a-z0-9-]+$ | | default | Act as default transport. Default: false | boolean |

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License