DEV Community

José Pablo Ramírez Vargas
José Pablo Ramírez Vargas

Posted on • Updated on

Humbly presenting the next generation configuration package

Hello everyone!

I have been working on a flexible, configurable and extensible configuration engine for NodeJS and browser frameworks alike and today I released v2 in beta.

I have great confidence in it and therefore I wanted to introduce it to the world: wj-config.

It is inspired by .Net's Configuration mechanism as I find it, in a word, excellent.

Summary

It works on NodeJS applications (CommonJS and ES Modules), including Express, and also can be used in browser frameworks like React. The Version_2 branch in GitHub has working examples. I am not a front-end dev, so I cannot say for sure if or how well it works with other browser frameworks, but I'm willing to bet it works. If you test a framework, please let me know if it works.

It has 6 different ways to obtain configuration data: Objects, fetched objects, dictionaries, environment variables, single values and raw JSON. Each source has different configuration options.

If you need, you may create new data sources as you see fit as it is an extensible configuration framework.

Personally, what I find most useful is how URL's are defined: One simply adds them to a sub-section called ws and the configuration engine converts them into functions that can replace values and add query strings, all while URL-encoding the replacement values.

I could go on and on, but I already did this in its extensive ReadMe file, so I invite you all to check it out in hopes that you like it and find it useful.

Cheers!

Top comments (0)