GoFuncYourself is a library that converts proper JavaScript code into tuple return, Golang-style functions.
npm install go-func-yourself
It's as easy as
import gfy from 'go-func-yourself'
let { res, err } = gfy(() => {
// ... your func
});
if (err) {
// ... do error
}
// ... do success
Open a PR and I probably won't review it
MIT