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

denver

v0.3.2

Published

Create layers of ENV variables saved to etcd and deploy docker containers using them

Downloads

14

Readme

denver

Denver

Travis

Create layers of ENV variables saved to etcd and deploy docker containers using them

installation

$ npm install denver -g

usage

denver will save ENV variables for a stack under a key in etcd.

it will merge stacks in order so one stack can inherit from another.

it will spit out stacks environment in a few useful formats.

api

var den = denver(options)

create a new denver object using the options:

  • host - the etcd host (defaults to 127.0.0.1)
  • port - the etcd port (defaults to 4001)
  • key - the base key (default to /denver)

You can always use the envrionment variables to set these values:

  • DENVER_HOST
  • DENVER_PORT
  • DENVER_KEY
var denver = require('denver');

var den = denver({
	host:'127.0.0.1',
	port:4001,
	key:'/denver'
});

den.set(stack, key, value, callback)

set a value for a stack

den.set('app1', 'test', 'hello', function(err){
	// value is written
})

den.get(stack, key, callback)

get a value from a stack

den.get('app1', 'test', function(err, value){
	// value is here!
})

den.ls(callback)

list all of the stacks

den.ls(function(err, stacks){
	// stacks is an array of stack names
})

den.rm(stack, callback)

remove a stack from the db

den.rm('app1', function(err){
	// the app is gone
})

den.env(stacks, callback)

get an object with the values for the environment that is created from merging the stacks array.

den.env([
	'basestack',
	'applicationstack'
], function(err, env){
	// env is an object that is a merged stack env
})

You can also just get a single stack env:

den.env('app1', function(err, env){

})

events

den.on('set', function(stack, key, value){})

emitted when a value is set

den.on('del', function(stack, key, value){})

emitted when a value is deleted

cli

denver ls

List the stack names we have environments for

$ denver ls

denver rm

Remove a stack from the database

$ denver rm myapp

denver get

Print the value of a single environment variable

$ denver get myapp ADMIN_EMAIL

denver set

Write the value of a single environment variable

$ denver set myapp ADMIN_EMAIL [email protected]

denver del

Remove a value from an environment

$ denver del myapp ADMIN_EMAIL

denver env

Print the whole environment for a stack

$ denver env myapp

You can 'merge' several stacks with the env command - this lets you have 'global' envs or whatever:

$ denver env defaultenv myapp

When you merge - the last stack will take precendence - so myapp -> ADMIN_EMAIL would overwrite defaultenv -> ADMIN_EMAIL.

You can merge as many stacks as you want.

denver docker

You can also print the environment in a docker friendly format:

$ denver docker defaultenv myapp

This would output:

-e [email protected] -e HOSTNAME=bobthebuilder.com

denver inject

Read env vars one per line from stdin

file - myenv.txt:

HELLO=world
[email protected]
$ cat myenv.txt | denver inject myapp
$ denver docker myapp

This would print:

-e HELLO=world -e [email protected]

license

MIT