Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dotenv-yaml

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv-yaml

Minimal YAML .env.yml file loader

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

dotenv-yaml

Usage

As early as possible in your application, require and configure dotenv-yaml.

require('dotenv-yaml').config();

Preload

You can use the --require (-r) command line option to preload dotenv-yaml. By doing this, you do not need to require and load dotenv-yaml in your application code.

$ node -r dotenv-yaml/config your_script.js

The configuration options below are supported as command line arguments in the format dotenv_yaml_config_<option>=value

$ node -r dotenv-yaml/config your_script.js dotenv_yaml_config_path=/custom/path/to/your/env/vars dotenv_yaml_config_encoding=utf8

Create a .env.yml file in the root directory of your project, and add environment-specific variables as valid YAML.

That's it.

process.env now has the keys and values you defined in your .env.yml file.

Options

Path

Default: .env.yml

You can specify a custom path if your file containing environmnet variables is named or located differently.

require('dotenv-yaml').config({ path: '/custom/path/to/your/yaml/env/vars' });

Encoding

Default: utf8

You may specify the encoding of your file containing environment variables using this option.

require('dotenv-yaml').config({ encoding: 'base64' });

Keywords

FAQs

Package last updated on 29 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc