Buffer type only exists in NodeJS and not the browser. There are available polyfills. However, to use these, we would need a tool like webpack.
The Buffer type is only used to distinguish between node and browser processing env. A common way to do this is to check on window.
Use this way instead of instanceof Buffer