An Open Source Universe Project
- Catches Errors Before they become Fatal
- 0 Dependencies
- Typescript Support
npm install xrays
Read more about the Design behind xrays
here.
import { x } from 'xrays';
const throwable = async (shouldThrow: boolean) => {
if (shouldThrow) {
throw new Error('error');
}
return 'success';
}
const { data, error } = await x(throwable, false);
// { data: 'success', error: null }
const { data, error } = await x(throwable, true);
// { data: null, error: Error('error') }
xrays
is under active development, documentation will be added once an initial release is ready.
We would love for you to contribute your ideas, code, & fixes to xrays
.
We encourage everyone to read our Design Document to learn more about the thought process behind xrays.
Also check out the rewards offered for contributing to the Open Source Universe.
MIT