Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@strong-roots-capital/docker-secrets

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@strong-roots-capital/docker-secrets

FP loading of docker secrets, falling back on env vars

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
2
Created
Source

docker-secrets Build status npm version codecov

FP loading of docker secrets, falling back on env vars

Install

npm install @strong-roots-capital/docker-secrets

Use

import { secrets } from '@strong-roots-capital/docker-secrets'

async function main() {

    console.log((await secrets.get('user')).orDefault('Ishmael'))
    console.log(secrets.getSync('PWD'))

    const getFromRoot = secrets.getFrom('/root/super-secrets-do-not-share')

    console.log(await getFromRoot('launch-codes'))
    console.log(secrets.getFromSync ('/home/gob') ('illusions'))
}

main()

API

Functions

Functions

get

get(secret: string): Promise<Maybe<string>>

Defined in docker-secrets.ts:100

Get a secret asynchronously, first checking /run/secrets and then falling-back to environment variables.

Parameters:

NameType
secretstring

Returns: Promise<Maybe<string>>

getSync

getSync(secret: string): Maybe<string>

Defined in docker-secrets.ts:116

Get a secret synchronously, first checking /run/secrets and then falling-back to environment variables.

Parameters:

NameType
secretstring

Returns: Maybe<string>

getFrom

getFrom(directory: string): (secret: string) => Promise<Maybe<string>>

Defined in docker-secrets.ts:108

Get a secret asynchronously, first checking directory and then falling-back to environment variables.

Parameters:

NameType
directorystring

Returns: (secret: string) => Promise<Maybe<string>>

getFromSync

getFromSync(directory: string): (secret: string) => Maybe<string>

Defined in docker-secrets.ts:124

Get a secret synchronously, first checking directory and then falling-back to environment variables.

Parameters:

NameType
directorystring

Returns: (secret: string) => Maybe<string>

Keywords

functional

FAQs

Package last updated on 18 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts