New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

dianda-config

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dianda-config

Sync request,wait child process,Based on the zookeeper client implementation for configuration

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

dianda-config

Sync request,wait child process,Based on the zookeeper client implementation for configuration. This module is generally identical to sync-request, use spawnSync achieve sync request to zookeeper server node,after get config,child process exit then parent process go on. This module has been tested to work with node-zookeeper-client version 0.2.2.

Chinese: 这个模块通过开辟子进程,实现同步远程获取服务配置,前提是需要在zookeeper节点配置config参数,当子进程获取配置成功或失败,子进程退出, 主进程才得以继续,在子进程未exit之前主进程处于wait状态,所以慎用, 注:该module完全模仿了sync-request

Installation

You can install it using npm:

$ npm install dianda-config

Documentation

Arguments

  • zk_ip String - Comma separated host:port pairs, each represents a ZooKeeper server. You can optionally append a chroot path, then the client would be rooted at the given path. e.g.

  • options Object - An object to set the client options. Currently available options are:

    • rootNode like "/config"(default:/dianda-config) optional.
    • system like order,inventory etc.
  • callback function

Example

your zookeeper node must have path for /dianda-config/order .
/dianda-config/order
                     /redis
                           /host (the data of host:192.168.1.1:6379)
                     /database
                           /host (the data of host:192.168.1.101:3306)
var config = require('dianda-config')(
    '192.168.1.214:2181',
    {
        rootNode:'/xxx',
        system:'xx'
    });
// the config is 
{
    redis:{host:'192.168.1.1:6379'},
    database:{host:'192.168.1.101:3306'}
} 
console.log(config);

Dependency

This module depends on the following third-party libraries:

License

This module is licensed under MIT License

Keywords

zookeeper

FAQs

Package last updated on 05 Dec 2016

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