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

teade

v1.0.2

Published

inter service communication using http

Downloads

1,387

Readme

Teade

IPC(Inter Process Communication) package using RPC over HTTP.

Note:

If you use node < 4.0 then stick to version 0.0.6.

To install run npm i -s [email protected].

This version is completely stable but if you need some additional features from the latest version, raise an issue on github.

Why do you need it?

You probably need this for communicating with different microservices in a microservice architecture.

The most trusted and tested protocol is HTTP and this package uses HTTP to create a Client-Server connection so it can call remote procedures in a reliable manner.

Features

  • Reliability as it uses the HTTP protocol.
  • Few Dependencies.
  • Can be used over HTTPS if required.
  • Scalable - Use with an internal load balancer or let teade chose a random port.

TODO

Go Cross Platform, we are working on the go and .netcore versions of this package. Once done you can connect your servers and clients written in different languages.

If you need it in some other language or want us to speed up the process, then raise an issue on github and help us test.

Other requests for features, please raise an issue on github.

Installation

Install using npm:

npm install --save teade

Usage

Require library

const teade = require('teade');

Server

let server = new teade.Server();

server.addService({
	'readRPC': read
});

function read(call, callback) {
	myReadProceduralCall(call, function(err, response) {
		if (err){
			var error = new Error();
			// anything attached to error is sent as is
			callback(error);
		}else{
			callback(null, response);
		}
	});
};

server.bind(8080);
server.start();

Client

let client = new teade.Client('http://localhost', 8080);

// payload should always be a valid JSON
let payload = {
  name: "John"
}

client.request('readRPC', payload, function(err, response) {
	if (err) {
		// handle error
		// accessible data
			// err
	} else {
		//do something with the response
		// accessible data
			// response
	}
})

Client Parameters

| Name | Description | Example | | ------------- | ------------- | ------------- | | Host | hostname where the RPC server is running, prefix the protocol | http://localhost | | Port | port at which the RPC server is running | 8080 | | Host-Port Set | an array of host:port strings, Teade will then chose a random entry. | [ "http://localhost:8080", "http://localhost:8081" ] |

Example

see the test directory for now.