spring-config-parser

    1.0.5 • Public • Published

    Spring Config Parser

    A simple parser for Spring externalized configuration files.

    It takes a yaml file + a set of active profiles and returns an object with the computed configuration.

    Warning: This is highly untested and may only work for my specific use case. Use with caution.

    Usage

    const fs = require("fs")
    const path = require("path")
    const parser = require("spring-config-parser")
    
    const filePath = path.join(__dirname, "application.yml")
    const file = fs.readFileSync(filePath, "utf8")
    
    const configForProfile = parser(file)
    
    // Get the default configuration
    configForProfile()
    
    // Get the configuration for the "test" profile, merged with the default configuration
    configForProfile("test")
    
    // Get the configuration for the "test" and "ci" profiles,
    // merged together with the default configuration
    configForProfile(["test", "ci"])
    

    See the tests for more examples

    Keywords

    none

    Install

    npm i spring-config-parser

    DownloadsWeekly Downloads

    1

    Version

    1.0.5

    License

    MIT

    Last publish

    Collaborators

    • nevon