I have some code that runs as a Google Apps Script (GAS), iterating over a Google Doc's contents and extracting elements, using methods such as getBody
, getText
, getChild
, and so on. I'd like to port the code to run on Node.js. However when using the API, you get documents as a tree of static dictionary objects, rather than instances with these accessor methods.
I want an adaptor / facade that exposes the static object tree as a tree of class instances that offer the GAS methods aforementioned. (My parsing code is 2,500 lines and will get improvements.) Naturally, I'd quite like this for free, as it'd be a lot of work.
The GAS service must be doing this internally, extracting and returning details from the document object tree.
Is there anything available that does this, ie, allows me to use the document traversal GAS methods aforementioned outside of Google's GAS infrastructure?
(I don't want to use the GAS infrastructure as it is error prone, slow, time and rate limited, non-atomic, varies by user account type, and so on. However out of the box ideas very welcome indeed - I'm new to Google Apps.)