util-to

It is just simple util that helps you to write less code

Usage no npm install needed!

<script type="module">
  import utilTo from 'https://cdn.skypack.dev/util-to';
</script>

README

util-to

It is just simple util that helps you to write less code

So instead of writing:
try{
    const response = await this.instance.post(url, params)
}
catch(err){
    throw "Some error"
} 
You could write like that:
import to from 'util-to'

const [err, response] = await to(this.instance.post(url, params))
if(err) throw "Some error"

return response