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

@hapipal/confidence

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapipal/confidence

Dynamic, declarative configurations

  • 6.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

confidence

Dynamic, declarative configurations

Build Status Coverage Status

Lead Maintainer: Sunny Bhanot

Installation

npm install @hapipal/confidence

Usage

See also the API Reference

Confidence is intended for use with nodejs v12+ (see v4 for lower support).

Confidence is a configuration document format, an API, and a foundation for A/B testing. The configuration format is designed to work with any existing JSON-based configuration, serving values based on object path ('/a/b/c' translates to a.b.c). In addition, Confidence defines special $-prefixed keys used to filter values for a given criteria.

Example

Below is an example configuring a hapi server using a dynamic Confidence configuration.

const Hapi = require('@hapi/hapi');
const Confidence = require('@hapipal/confidence');

const store = new Confidence.Store({
    server: {
        host: 'localhost',
        port: {
            $param: 'PORT',
            $coerce: 'number',
            $default: 3000
        },
        debug: {
            $filter: 'NODE_ENV',
            $default: {
                log: ['error'],
                request: ['error']
            },
            production: {
                request: ['implementation']
            }
        }
    }
});

const config = store.get('/', process.env);

const server = Hapi.server(config);

Extras

Confidence originated in the hapijs organization, and was adopted by hapi pal in April 2019.

confidence Logo

Keywords

FAQs

Package last updated on 27 Mar 2021

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