util-to

1.0.2 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i util-to

Weekly Downloads

3

Version

1.0.2

License

ISC

Unpacked Size

895 B

Total Files

3

Last publish

Collaborators

  • pavliha