How to use the envalid.get function in envalid

To help you get started, we’ve selected a few envalid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github edyn / docker-docker-stats-statsd / index.js View on Github external
var env = require('envalid');
var StatsD = require('node-statsd');
var allcontainers = require('docker-allcontainers');
var dockerstats = require('docker-stats');
var _ = require('lodash');
var through = require('through2');

env.validate(process.env, {
  STATSD_HOST: {recommended: true},
  STATSD_PORT: {recommended: true},
  STATSD_PREFIX: {recommended: true},
});

var statsdClient =  new StatsD({
  host: env.get('STATSD_HOST', '127.0.0.1'),
  port: env.get('STATSD_PORT', 8125),
  prefix: env.get('STATSD_PREFIX', 'docker.'),
});

/*statsdClient = {
  gauge: function(key, value){
    console.log(key, value);
  }
}*/

var stats = dockerstats({
  docker: null,
  events: allcontainers({
    preheat: true,
    docker:null})
});
github edyn / docker-docker-stats-statsd / index.js View on Github external
var env = require('envalid');
var StatsD = require('node-statsd');
var allcontainers = require('docker-allcontainers');
var dockerstats = require('docker-stats');
var _ = require('lodash');
var through = require('through2');

env.validate(process.env, {
  STATSD_HOST: {recommended: true},
  STATSD_PORT: {recommended: true},
  STATSD_PREFIX: {recommended: true},
});

var statsdClient =  new StatsD({
  host: env.get('STATSD_HOST', '127.0.0.1'),
  port: env.get('STATSD_PORT', 8125),
  prefix: env.get('STATSD_PREFIX', 'docker.'),
});

/*statsdClient = {
  gauge: function(key, value){
    console.log(key, value);
  }
}*/

var stats = dockerstats({
  docker: null,
  events: allcontainers({
    preheat: true,
    docker:null})
});
github edyn / docker-docker-stats-statsd / index.js View on Github external
var StatsD = require('node-statsd');
var allcontainers = require('docker-allcontainers');
var dockerstats = require('docker-stats');
var _ = require('lodash');
var through = require('through2');

env.validate(process.env, {
  STATSD_HOST: {recommended: true},
  STATSD_PORT: {recommended: true},
  STATSD_PREFIX: {recommended: true},
});

var statsdClient =  new StatsD({
  host: env.get('STATSD_HOST', '127.0.0.1'),
  port: env.get('STATSD_PORT', 8125),
  prefix: env.get('STATSD_PREFIX', 'docker.'),
});

/*statsdClient = {
  gauge: function(key, value){
    console.log(key, value);
  }
}*/

var stats = dockerstats({
  docker: null,
  events: allcontainers({
    preheat: true,
    docker:null})
});

stats.pipe(through.obj(update));