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

kitoo-core

v1.1.22

Published

* [What Is Kitoo-Core](#about) * [How To Install](#installation) * [API](#api) * [CLI](#cli) * [Examples](#examples) * [Contributing](#contributing) * [License](#license)

Downloads

19

Readme

Kitoo-Core

What Is Kitoo-Core

kitoo-core is service based on zeronode, for creating server to server communication.

How To Install

For library usage.

npm install kitoo-core

And For kitooc-core cli usage.

npm install -g kitoo-core

API

Basic Concepts

There is two basic concepts in kitoo-core, Network and Router. Network service connects to Routers and communicates to other Network services through Routers. In other end Routers are just connecting together Ntworks. We will call Existing Network to already connected Routers an Networks. So all Routers in Existing Network mus be connected to All Networks.

Router

Network

Router Service

Router Service connects all network services to each other.

Network Service

Network Service can send and get messages from other services. Network Services can send messages to other Network Services via Router Service.

All network Services must be connected to All Router Services.

Usage Example

router.js

import {Router} from 'kitoo-core'

(async function () {
    try {
       let router = new Router({ bind: 'tcp:://127.0.0.1:3000' });
       await router.start();
       console.log('router started')
    } catch (err) {
       console.error(err) 
    }
}());

service1.js

import {Network} from 'kitoo-core'

(async function () {
    try {
        let network = new Network({name: 'foo', routers: ['tcp://127.0.0.1:3000']})
        await network.start();
        
        console.log('service1 started');
        
        network.onTick('baz', (msg) => {
            console.log('got message on baz event:', msg)
        })
    } catch (err) {
        console.error(err)
    }
}())

service2.js

import {Network} from 'kitoo-core'

(async function () {
    try {
        let network = new Network({name: 'bar', routers: ['tcp://127.0.0.1:3000']})
        await network.start();
        console.log('service2 started');
        let service1 = network.getService('foo');
        service1.tickAny('baz', 'Hi service1, I am service2.')
    } catch (err) {
        console.error(err)
    }
}())
#terminal 1
$ babel-node router.js
router started

#terminal 2
$ babel-node service1.js
service1 started
got message on baz event: Hi service1, I am service2.

#terminal 3
$ babel-node service2.js
service2 started