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

muchconf-consul-provider

v1.2.1

Published

Consul provider for muchconf

Downloads

5

Readme

muchconf consul provider

npm Build Status

Muchconf configuration provider for consul KV store. It supports application reloading on configuration update.

Consul is a distributed service mesh to connect, secure, and configure services across any runtime platform and public or private cloud (see: consul.io)

Getting started

Install module using your favorite package manager.

npm install muchconf-consul-provider

Create muchconf configuration store with consul provider. key is name of directory in consul store where configuration is kept. See muchconf repository for more information how to use store.

const { muchconf } = require('muchconf');
const { muchConsul } = require('muchconf-conusl-provider');

const configStore = muchconf([
    muchConsul({
        key: 'myService'
    })
]);

configStore.on('ready', (config) => {
    console.log('Service running at ' + config.ip + ':' + confgi.port);
});

configStore.load();

Class: ConsulProvider

Syntax:

new ConsulProvider(options, commonProviderOptions);

or

muchConsul(options, commonProviderOptions);

| name | type | required | default | description | |------------------|----------|-----------|-----------|----------------| | options | object | yes | | options for consul provider | | options.host | string | no | 127.0.0.1 | agent address (see: silas/node-consul) | | options.port | number | no | 8500 | agent HTTP(S) port (see: silas/node-consul) | | options.secure | boolean | no | false | enable HTTPS (see: silas/node-consul) | | options.ca | String[] | no | | array of strings or Buffers of trusted certificates in PEM format (see: silas/node-consul) | | options.defaults | object | no | | common method call options that will be included with every call (ex: set default token), these options can be override on a per call basis (see: silas/node-consul) | | options.key | string | yes | | the consul directory where configuration is stored | | options.watchInterval | number | no | | the time in milliseconds to wait in between checking of configuration update | | commonProviderOptions | object | no | see below | common options for provider | | commonProviderOptions.castNumbers | boolean | no | false | if possible, strings will be converted to number, e.g. '2' will be 2 | | commonProviderOptions.convertTrueFalseStrings | boolean | no | false | strings like 'true' or 'false' will be converted to boolean | | commonProviderOptions.cutQuotations | boolean | no | false | double quotation marks form beginning and ending of string will be cut off. E.g. '"some value"' will be 'some value' | | commonProviderOptions.not | object | no | | conditions when provider should not be used | | commonProviderOptions.is | object | no | | conditions when provider should be used |

Events:

update fired on configuration change if configuration watching is enabled.

Tests

npm run test