ENH: Added append functionality for DataFrame.to_json
- [X] closes #35849
- [X] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [X] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [X] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/v1.5.0.rst` file if fixing a bug or adding a new feature.

Added new a new keyword argument (mode) to DataFrame.to_json(). Strictly only takes 'w' and 'a' as inputs, defaulting to 'w'. mode='a' is only supported when lines is True and orient is 'records'. This enhancement only effects to_json when a path_or_buf is supplied, otherwise it returns the json dump like expected, however, checks will occur when mode='a' regardless of whether path_or_buf is supplied. 

This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. @mroeschke Is there anything that I need to do for this PR? or are we just waiting for the right time to merge it in?  > @mroeschke Is there anything that I need to do for this PR? or are we just waiting for the right time to merge it in?


Looks like this needs a rebase and there are still typing errors: https://github.com/pandas-dev/pandas/actions/runs/3057060394/jobs/4931831550 @mroeschke I'm still unsure about this typing issue that it's failing. Could you help me out with that? Also, I realize I need to adjust which whatsnew file i'm changing so just let me know which one I need to add it to and I'll do that. Not sure why 1.6.0 is showing as a completely new file on my commit... The overloads in `pandas/io/json/_json.py` need to be adjusted for `mode`.

Yeah the `v1.6.0.rst` was renamed to `v2.0.0.rst` so the 2.0 version should be added @mroeschke Looks like that fixed the docstring issue. Now I'm just unsure of what whatsnew to put the enhancement information in.  > Now I'm just unsure of what whatsnew to put the enhancement information in.

You can put it in `v2.0.0.rst` @mroeschke Finished. Let me know if there's anything else that I need to do.  Thanks for sticking with this @SFuller4!  Thanks for the assistance @mroeschke! Next time should be smoother haha