pilwon / node-get-config Goto Github PK
View Code? Open in Web Editor NEWAutomagically build a config object used throughout an application
Automagically build a config object used throughout an application
I'm migrating from node-config
and one thing I liked about that was that it automatically merged local
config files, intended for local, unsourced overrides.
It would be great in node-get-config
would merge in things from an optional local
folder as a last step in merging.
Thoughts?
I have a few config files (e.g. webpack) that are .js
with a module.exports
. Seemingly this is not supported by node-get-config.
I'm converting from https://www.npmjs.com/package/config, where I could have .js
config files.
Is this something you would consider adding or accept a PR?
The code that checks properties of the filesystem uses lstat
. The difference between lstat
and stat
from the docs:
lstat()
is identical tostat()
, except that ifpath
is a symbolic link, then the link itself is stat-ed, not the file that it refers to.
This prevents the usage of symbolic links to config files and directories. Is this intentional? Could stat
be used instead?
Your examples have client and server config files. Just wondering if you had a good solution for actually using this as client side configuration?
I've been using https://github.com/lorenwest/node-config for a bit, but just noticed your package.
Just wondering if you've used it and if you can offer any comparisons to how node-get-config
works, or why you'd choose one over the other.
On the surface, I like that node-get-config
seems a bit simpler/less-magical than node-config
.
Also, node-config
values are immutable, which I see the benefit of but has also caused a bit of trouble.
Thanks!
The deasync dependency is set to version 0.0.10, but I cannot compile that version any more on my up-to-date windows machine. The newest version however (0.1.7) compiles fine.
Is it possible to update the dependency to a newer version?
It would be a nice addition if one could also use configuration files nested in folders, which will then be parsed recursively (like is the case with Kohana's CFS), e.g.:
config/
+-- dev/
+-- locales/
+-- en.yml
+-- locales/
+-- en.yml
+-- es.yml
Will result in:
{
"locales": {
"en": {
"foo": "bar"
},
"es": {
"foo": "barra"
}
}
}
Other node config libraries have the concept of a "local" config, that would be merged in last, meant for local, unsourced overrides.
So for node-get-config
, this would mean a config/local
folder that got merged in last.
Any thoughts about this? Do you think this is something that should/could be built-in, or something that should be done manually?
https://github.com/HenrikJoreteg/getconfig#where-to-put-your-config-and-what-to-call-it
https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-load-order
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.