bevry / envfile

Parse and write environment files with Node.js
Other
61 stars 10 forks source link

maintain comments when parsing #192

Open jamiehaywood opened 2 years ago

jamiehaywood commented 2 years ago

It would be good to maintain comments when parsing an stringifying.

I'm not entirely sure how you would implement, but perhaps you could set lines with a # to be undefined and then write them from the object back to a line with just a key and no value?

dhlavaty commented 1 year ago

+1 for comment support

We use envfile for generating many setup scripts and automations. It would be great, if we could add a comment to the first line of generated files. Like:

# This file was autogenerated. Do not edit by hand.
VAR=abc
...
leemm commented 1 year ago

I would appreciate this too.