@contrast/config
TypeScript icon, indicating that this package has built-in type declarations

1.28.2 • Public • Published

@contrast/config


Note: This package needs help.

  • Needlessly dependent on commander, lodash, and json-stable-stringify
  • Can be simplified
  • Could benefit from schema-based approach for defaults

Overview

This is legacy code ported from node-agent repo.

To discover and log configuration data, try

node -e "console.log(new (require('.').Config)())"

Usage

An agent should use a single instance of a config. On instantiation, the config will detect both yaml file and environment variable sources and build out full config object. The object will have defaults set for values not having been set by file or env vars.

const { AgentConfig } = require('@contrast/config');
const config = new AgentConfig();

// do stuff with config
if (config.protect.enable) {

}

New V5 Options

  • agent.stack_trace_filters

    This allows agent stackframes to be filtered via configuration Default: agent-,@contrast,node-agent

Readme

Keywords

none

Package Sidebar

Install

npm i @contrast/config

Weekly Downloads

24,690

Version

1.28.2

License

SEE LICENSE IN LICENSE

Unpacked Size

45.5 kB

Total Files

8

Last publish

Collaborators

  • planetlevel
  • contrastsec
  • tough-griff
  • annettenugent
  • michaelwitz
  • chrisdunne
  • contrast_admin
  • jcolekaplan
  • bmacnaughton