1.1.2 • Published 2 years ago

@leebmann24/recursive-yaml-loader v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@leebmann24/recursive-yaml-loader

loads yaml files recursively from a given folder. properties are grouped by it's filename (without extension) or foldername With this tool you are able to split up your configuration yamls into several files for clearity and maintainability.

install

$ npm install @leebmann24/recursive-yaml-loader

or

$ yarn add @leebmann24/recursive-yaml-loader

example

import loader from '@leebmann24/recursive-yaml-loader'

interface Config {
    file1: {
        property1: string
        list: string[]
    }
    
    aFolder: {
        file: string[]
    }
    
}


const config = loader.load('path/to/config/folder') as Config

parent/child combination

a file with the same name as the folder in which it's in will be merged into its "parent"

  • propXY (folder)

    • propXY.yml (will NOT be encapsulated)
      • hello: "world"
    • anotherProp.yml (will be encapsulated)
      • abc: "xyz"
{
    "propXY": {
        "hello": "world",
        "anotherProp": {
            "abc": "xyz"
        }
    }
}
1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago