Sign inSign up

nevon/spring-config-parser

By nevon

•Updated over 9 years ago

A simple parser for Spring externalized configuration files

Image
0

1.7K

nevon/spring-config-parser repository overview

⁠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

Tag summary

Content type

Image

Digest

Size

22.8 MB

Last updated

over 9 years ago

docker pull nevon/spring-config-parser