How to execute server side file handling/merging operations?

I’m storing Word(.docx) files using GridFS on the server. I’d like to be able to merge the documents into one Word file by using the docx-builder NPM package.

How can I go about doing this on the server side ? I can only do this server side because the package I’m using requires the fs package which cannot be executed client side.

Any advice on how to approach this ? Thank you.