await-to-js
fawait
Our great sponsors
await-to-js | fawait | |
---|---|---|
6 | 5 | |
3,168 | 107 | |
- | - | |
0.0 | 0.9 | |
3 months ago | about 1 year ago | |
TypeScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
await-to-js
-
Handle Javascript errors like in Go
While writing this, I found that someone already thought about this much earlier than me, check out this article: https://blog.grossman.io/how-to-write-async-await-without-try-catch-blocks-in-javascript/
-
try/catch in TypeScript is such a gigantic pain in the ass. Even worse if used in Node, holy hell...
I've seen a nearly identical utility library called await-to-js but that's what I was going to suggest as well as the pattern does make error handling a lot easier and less nested.
- if err != nil for JavaScript
-
Stop catching errors in TypeScript; Use the Either type to make your code predictable
Someone even thought the same and made it a lib. https://github.com/scopsy/await-to-js
-
Cleaner async-await for asynchronous JavaScript
This was inspired by await-to-js library, and I use it in almost all my JS projects. Go give them a star.
-
Promisify functions and avoid callback hell | node js
Does this help? https://github.com/scopsy/await-to-js
fawait
-
Avoiding Async/Await Footguns
I recently learned about fAwait, which approaches in a more functional way of writing. It adds some utility functions and a way to pipe errors into the next "layer" and add side effects. Kind of like middlewares.
-
try/catch in TypeScript is such a gigantic pain in the ass. Even worse if used in Node, holy hell...
Checkout fawait. It helps a bit. Not with typing the error, but it does help
-
is Try Catch the only way to deal with a failed await?
Came across a cool lib to help with this, called fawait.
- A library for specific error type handling in async code
- FAwait-JavaScript library for working with the await syntax
What are some alternatives?
ts-pattern - 🎨 The exhaustive Pattern Matching library for TypeScript, with smart type inference.
proposal-record-tuple - ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!
proposal-pattern-matching - Pattern matching syntax for ECMAScript
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
ts-option
node - Node.js JavaScript runtime ✨🐢🚀✨
good-try - Tries to execute a sync/async function, returns a specified default value if the function throws
promises-training - Practice working with promises through a curated collection of interactive challenges. This repository provides a platform to refine your skills, complete with automated tests to to give you instant feedback and validate your progress.