Questions for implementing "ipfs diag cmds" in javascript

I’m trying to keep an record of the commands that I performed in ipfs. In go-ipfs we are able to find out via “ipfs diag cmds”. However, in pointed out that there are no js-implementation of “ipfs diag cmds”.

How can I implement “ipfs diag cmds” in javascript in an elegant approach, but without loss its performance.

Thank you for reading!