1.1.6 • Published 5 years ago

@folk-org/yaml-config v1.1.6

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

yaml-config

A Node.js module that load configuration from Yaml file. Files can be templated with environment variables.

Installation

npm install @folk-org/yaml-config
yarn add @folk-org/yaml-config
bower install @folk-org/yaml-config --save

Usage

Assuming the following Yaml file

databaseUrl: test
sharedKey: ${ SHARED_KEY || shared_key }

Javascript

const yml = require('@folk-org/yaml-config');
console.log(yml.parseFile('./', 'test.yml'));
console.log(yml.parseFileToCommandLine('./', 'test.yml'));

Output should be

{ databaseUrl: 'test',
  authenticationSharedKey: 'shared_key' }
'databaseUrl=\'\' authenticationSharedKey=\'shared_key\''

If environment variable SHARED_KEY is defined with value secretValue

Output should be

{ databaseUrl: 'test',
  authenticationSharedKey: 'secretValue' }

TypeScript

import { parseFile, parseFileToCommandLine } from '@folk-org/yaml-config';
console.log(parseFile('./', 'test.yml'));
console.log(parseFileToCommandLine('./', 'test.yml'));
1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago