Closed danielpza closed 1 year ago
Is it possible to test?
Maybe we can use child_process or worker_thread to do that.
Is it possible to test? Maybe we can use child_process or worker_thread to do that.
Added some tests in 14bb2fb
(#296)
I forgot we already use child_process to run CLI test, we can add an option to accept stdin. https://github.com/keithamus/sort-package-json/blob/2789f2f440bfc67e6a8aeddf8a9605166e0d567d/tests/_helpers.js#L175 But it can be done in future, since it's not important.
I forgot we already use child_process to run CLI test, we can add an option to accept stdin.
Applied these changes in f7c3b6f
(#296)
We have --check
flag. Do you think we should support cat package.json | sort-package-json --stdin --check
?
We have
--check
flag do you think we should supportcat package.json | sort-package-json --stdin --check
?
I considered adding support for the other flags, but it's not a priority for my use case. I guess we can add more support in the future if needed
Is there any blocker for this PR, any chance to get it merged otherwise?
Thanks for the reminder @danielpza! 🎉🎉
:tada: This PR is included in version 2.5.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Passing the
--stdin
flag would make it so it reads fromstdin
and outputs tostdout
. This is useful for some tools/editors integrationUsage example:
Closes https://github.com/keithamus/sort-package-json/issues/293