New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

config-yaml

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config-yaml

YAML configuration for NodeJS

  • 1.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
increased by25.97%
Maintainers
1
Weekly downloads
 
Created
Source

Node version Version Build status dependencies Status devDependencies Status

config-yaml

YAML configuration for NodeJS

Basic example

config/default.yml:

foo: "bar"
list:
    - 1
    - 2
    - 3
import configYaml from "config-yaml";

const config = configYaml(`${__dirname}/config/default.yml`);

console.log(config.foo); // "bar"
console.log(config.list[1]); // 2

Example with imports directive

config/production.yml:

imports:
    - { resource: "default.yml" }
    - { resource: "routing/api.yml", property: "routing.api" }

foo: "hello"
tic: "tac"
import configYaml from "config-yaml";

const config = configYaml(`${__dirname}/config/production.yml`);

console.log(config.foo); // "hello"
console.log(config.routing.api); // Configuration from routing/api.yml

Available variables

VariableDescription
%__dirname%Directory path of the current YAML file
%__filename%Current YAML file path

FAQs

Package last updated on 20 Jul 2020

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