datamaker icon indicating copy to clipboard operation
datamaker copied to clipboard

Save files

Open DSigmund opened this issue 4 years ago • 3 comments

Allows to Save XML and JSON Output as Files.

JSON has a special option to pull a property as filename.

DSigmund avatar Nov 05 '20 09:11 DSigmund

Thanks for the feature @DSigmund . It would be even better if each feature was its own pull request. For instance, this pull request has both the pretty-print & save-code features. I can't merge one without the other.

glynnbird avatar Nov 05 '20 13:11 glynnbird

I'm not convinced of the need for the "save" functionality in datamaker. A command-line user can easily "save" data:

echo "{{name}}" | datamaker -i 100 > output.txt

A programmatic user can easily do something similar to your code by listening to the "on data" event. But I'm not convinced that it's universally useful - it may be useful to you, but I'm not sure that many other users would find it useful?

Happy to hear counter arguments :)

glynnbird avatar Nov 05 '20 13:11 glynnbird

Thanks for the feature @DSigmund . It would be even better if each feature was its own pull request. For instance, this pull request has both the pretty-print & save-code features. I can't merge one without the other.

Well, i tried to do this, using two different branches at my side ... i think i made an error somewhere, sry ...

A programmatic user can easily do something similar to your code by listening to the "on data" event. But I'm not convinced that it's universally useful - it may be useful to you, but I'm not sure that many other users would find it useful?

Think about having an application where you need some JSON-Data-Files as Backend. Everyone is its own File. Than you can easily use one template and one command-line (eg as npm-script) to create lots of data.

DSigmund avatar Nov 05 '20 15:11 DSigmund