How to adapt a library for Instance Mode (P5JS)

Right okay, but that means that in the instance mode, you’re calling the function and passing in the instance. In other libraries, the function can be called by the instance i.e.

var sketch = p5(function(p){p.setup(){...}; p.draw(){p.function(){}}})

as opposed to

var sketch = p5(function(p){p.setup(){...}; p.draw(){function(p){}}})