Skip to content

Conversation

@DSigmund
Copy link
Contributor

@DSigmund DSigmund commented Nov 5, 2020

Allows to Save XML and JSON Output as Files.

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

@glynnbird
Copy link
Owner

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
Copy link
Owner

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 :)

@DSigmund
Copy link
Contributor Author

DSigmund commented Nov 5, 2020

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.

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

Successfully merging this pull request may close these issues.

2 participants