Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kitejs

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kitejs

the rpc framework Kite for Node.js

  • 1.0.6
  • npm
  • Socket score

Version published
Weekly downloads
46
increased by109.09%
Maintainers
1
Weekly downloads
 
Created
Source

kitejs

说明

kitejs 提供统一访问服务的 client,支持 Http、RPC(thrift) 协议,提供多种编解码方式(正在支持)。 kitejs 集成寻址、支持负载均衡策略

使用

首先进行安装

npm install kitejs --save

使用方法

// for HTTP
const kite = require('kitejs');

var client = new kite.Client(
    {
        'host': '127.0.0.1',
        'port': 8080,
        'protocol': 'HTTP'
    }
);

client.request({ path: '/' }, function (err, data) {
    if (err) throw err;
    console.log(data);   
});

// for THRIFT
const kite = require('kitejs');

var client = new kite.Client(
    {
        'host': '127.0.0.1',
        'port': 8080,
        'protocol': 'THRIFT'
    }
);

client
    .loadService(__dirname + '/thrift/gen-nodejs/Calculator.js')
    .request(function (err, cal, conn) {
        if (err) throw err;
        cal.ping(function (err, response) {
            console.log('ping()');
        });

        cal.add(1, 1, function (err, response) {
            console.log(response);
        });
    });

// for CONSUL
const kite = require('kitejs');

var client = new kite.Client({
    service: 'ies.fe.mis',
    searchHostType: 'CONSUL'
});

client.request({path: '/'}, function (err, data) {
    console.log(data);
});

接口

Keywords

FAQs

Package last updated on 14 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc