bevry/cson

Allow .cson suffix-free files to be parsed

Closed this issue · 4 comments

gvn commented

I'm trying to use CSON for a config file I'm naming .bzrc.

I'm using parseFileSync and getting this error:

[Error: CSON.parseFileSync: Unknown extension type for /Users/gsuntop/.bzrc]

Renaming to .bzrc.cson works as expected, but I'd prefer not to use this suffix. Can non-suffixed files be allowed to work? Thanks!

As a side note, you should follow the XDG standard and use ~/.config. So something like ~/.config/bz/bzrc.

Yeah I agree. On a side-note, related to this, can you please accept stdin as valid input? I'd expect json2cson <<< '"foo": "bar", "baz": {"bam": [1,2,3,4]}' or the likes echo '...' | json2cson to work. Or at the least a -s for string input would be nice.

Can someone send a pull request for this and I'll review.

Closing due to lack of initiative on this issue showing a lack of value (cost vs benefit) for this issue