1.0.1 • Published 8 years ago

dockerode-authconfig v1.0.1

Weekly downloads
11
License
MIT
Repository
github
Last release
8 years ago

SYNOPSIS

Normalize auth info from ~/.docker/config.json to the authConfig format for the docker daemon.

USAGE

Install: npm i dockerode-authconfig

var assert = require('assert');
var normalize = require('.');
var orig = {
  auths: {
    'foo.bar.baz': {
      email: 'foo@bar.com',
      auth: 'QGZvbzpzdXBlcmR1cGVyZG8='
    },
    'already.ready': {
      username: '@ok',
      password: 'okyouwin'
    }
  }
};
var res = normalize(orig);
assert.deepEqual(res, {
  auths: {
    'foo.bar.baz': {
      username: '@foo',
      password: 'superduperdo'
    },
    'already.ready': {
      username: '@ok',
      password: 'okyouwin'
    }
  }
});
console.log('----orig----');
console.log(orig);
console.log('----norm----');
console.log(res);