Closed kjsmita6 closed 9 years ago
Ok, I like these new changes. Let's explore this a bit... I do often write JSON records to a file, but I use a streams. What's your use case?
If by "use case" you mean how I use it, one example is if someone tries to steal items from my Steam Bot (seishun/node-steam). I can append to a json file the user's name, their id, the time, etc. I would mainly use appendFile sort of like a custom JSON log. Yes, I could use Winston logger for this, but jsonfile allows me to customize what I log.
Bumping as it's been almost a week without a reply.
Bumping as it's been almost a week without a reply.
Sorry about that. I'm not trying to ignore you as I have been contemplating this. This is a really good PR with really good functionality. I have some problems with this at the moment:
readFile
, writeFile
are used in the context of one JSON object (one JSON record), whereas appendFile
would imply appending another JSON object, i.e. this JSON file would have multiple JSON objects (multiple JSON records). Would this be confusing? Is there a standard / mime-type of newline delimited JSON?As much as I'd like to accept this, I'm going to reject this unless some thoughts/points are raised that perhaps I didn't consider.
Please share any thoughts that you have on this (obviously to the degree as to which you feel it's worth your time). Thanks for your interest in this module.
I believe this time the changes I made are a lot better. I added the asynchronous version, kept the current style, and added tests. I think that the addition of appendFile will be greatly helpful for any users who really want to use it.