I don't know of a way to do this, but you have some options.
Option 1: embed your sketch as a canvas
element, which is what p5.js is designed to do. My gut tells me that this is probably what you should really do.
Option 2: save your sketch (or several versions of your sketch) as an image by right-clicking it, and then serve that as a normal image.
Option 3: do some kind of server-side rendering of a p5.js canvas, and serve that as an image. This is pretty advanced, but you can google "p5.js server side" for more info. My gut tells me that this is probably not what you should really do.
Honestly it sounds like you're trying to use p5.js for something it wasn't meant for. Most places you can embed an image, you can embed a p5.js canvas, so my guess is that you probably want to do that instead. But server-side rendering is the direction I would explore if you're super curious.