Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cson support #2

Open
dkebler opened this issue Oct 20, 2016 · 1 comment
Open

cson support #2

dkebler opened this issue Oct 20, 2016 · 1 comment

Comments

@dkebler
Copy link

dkebler commented Oct 20, 2016

can use the map feature to parse any file type to an object.?

In particular I need to create an object from a single directory of cson files.

I already have a few line single file function using https://github.com/groupon/cson-parser and was going to write something with glob-fs for a whole directory but if your package will do it so be it.

if so a hint or a few lines of code would be helpful.

@alykoshin
Copy link
Owner

alykoshin commented Nov 5, 2016

sorry for the delay with the answer.
require-dir-all module is based on require() function. So, it is not able (and not intended) to work with any type of files. I have another module, config-dir-all, but at the moment it also does not suits your task.

I think, here is what you need: https://github.com/lorenwest/node-config (not used it though, but it is very popular)
Specifically, this section describes the solution for your needs: https://github.com/lorenwest/node-config/wiki/Configuration-Files#coffeescript-object-notation---cson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants