keychain-env

0.1.0 • Public • Published

keychain-env

Set node process environment variables based on a secure note stored in the OS X keychain.

The contents of the note, or your template file, must be in the format expected by the dotenv package.

Example

const { setEnvFromNote } = require('keychain-env');
const path = require('path');

const options = {
  //  Ounce of prevention, pound of cure and all that.
  timeout: 3000,

  //  If this is our first time running and there is no note in
  //  the keychain yet then read a file from disk full of placeholder
  //  values and write that to the keychain so we know what values
  //  need to be filled in.
  templatePath: path.resolve(__dirName, 'variables.env.template')
}

setEnvFromNote('My App Name.env', options);

Package Sidebar

Install

npm i keychain-env

Weekly Downloads

0

Version

0.1.0

License

Unlicense

Last publish

Collaborators

  • meantime