Load only weights for NodeJS

I converted a model from Keras to be used in NodeJS. Currently, this model sets modelTopology: null, presumably because the file is the weights only.

I supposed it is possible to just write the network myself and load the weights only, using LayersModel.loadWeights (this is missing from the documentation afaik but the autocompletion shows it, and the source code as well.) however the weights themselves (currently binary) must be JSON, and I don’t see much information how to convert the binary weights to JSON so that they can be loaded.

Any help on this please?