dominictarr / rc

The non-configurable configuration loader for lazy people.
Other
1.02k stars 97 forks source link

Feature request: JS support #57

Closed MoOx closed 9 years ago

MoOx commented 9 years ago

That would be nice to support commonjs js. Some library and modules might require a smart configuration that can involve regex for example (famous eg: webpack). That would be nice to have support for JS exported module too. Are you open to this enhancement? I plan to use rc for cssnext and stylelint and it would be nice (especially for cssnext config that might require other modules/files).

dominictarr commented 9 years ago

I don't understand what you are asking for. do you want configuration as a js file?

MoOx commented 9 years ago

Yeah.

// ...

// config
module.exports = {/*...*/}
dominictarr commented 9 years ago

I'm not adding any more parsers, and i think there are some good reasons not to use javascript as configuration. but if you really want to do that you can pass in your own parser as documented in the readme.

panlina commented 5 years ago

Using js module as configuration file is desired in many cases and is quite common nowadays. I also hope it be supported.

MoOx commented 5 years ago

You should have a look to https://github.com/davidtheclark/cosmiconfig

panlina commented 5 years ago

Interesting. Thank you.

dominictarr commented 5 years ago

having a configuration file that is a turing complete language, with file system and network access, is a security vulnerability waiting to happen. rc will not be supporting that. if you really think you want that, fork or use a different module.