I have some questions regarding various rc
files in a typical node application, like .npmrc
, .babelrc
etc.
- What is an rc file, I know its a runtime-config for the module, but anything else?
- Does the rc file has to follow
.[module]rc
naming convention or is it just a recommended format? - What are the formats supported? I have seen both yaml and json formats, does it depend on the reader that the module use?
- How to access an rc file from a module's perspective? Does naming it as
[module]rc
would make it automatically available to the module? If so where will it be available? - Or should the module access the file just like any other file from the app that is using the module and expect it to be in an understandable format? (This is what I am doing right now, with json format)
- I have also seen people requiring
package.json
to load config. Which is recommended,package.json
or an rc file? - Also how does it differ from a javascript file like
gulpfile.js
withmodule.exports
? (I meant in the sense of recommendations, of course I know the difference and advantages of the js and rc files)
Every time I search in google, I end up here and here, which is a tool to read rc file but doesn't explain what are they or how are they constructed and/or connected to the module.
Any insight would be really useful. Thanks
.bashrc
, etc. mean? – Lindon