Basically this is a JSON-like parser that results in various types of values to JS... (not just a specific neural network interface)
I setup a JS->Native code object, that has the access methods to the native module, and some data tracking stuff..
This is 'objects' which is an array of values which are in JS, but are referenced from the C++ code via an index number into the array..
These are examples that create a new array, or object... further down more elemental objects are created and pushed into the value array...
(Set object by Index) - assign another referenced object into another....
After playing with this for a while, I really gave up on this approach for my own purposes, the overhead of creating JS objects from WASM during the process of parsing JSOX(JSON) was much slower than just doing it in JS natively...
Also you don't really NEED a preload code.. you can just have the require in an init... which can setup the interface area between the native and JS code...