@venuee/docker-secrets

Converts Docker Secrets mounted into a container to an object.

Usage no npm install needed!

<script type="module">
  import venueeDockerSecrets from 'https://cdn.skypack.dev/@venuee/docker-secrets';
</script>

README

Docker Secrets

This NPM module loads Docker secrets from directory created by Docker Swarm into a JS object for use within Node.js applications.

Installation

npm install @venuee/docker-secrets

Usage

const getSecrets = require('@venuee/docker-secrets');

const secrets = getSecrets('/run/secrets')
// or const secrets = getSecrets('/run/secrets/myDir')

console.log(secrets)

{
    secret_1: ...,
    secret_2: ...,
}

const secret_1 = secrets['secret_1'];