First of all, automating MS Word from any web server is not really a good idea.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.
It seems you need to received the byte array and then save it as a file on the client side, see How to load Word document from byte array for more information. But I don't think any JS code can access the local filesystem for security reasons. The best what your application could do is to ask users to download the generated file. Or just open the file in Office365 editor prior uploading the generated file to the OneDrive server.