Skip to content

intellibus/xrays

Repository files navigation

xrays

Xrays — Catch Errors before they become Fatal

An Open Source Universe Project


Contents

Features ✨

  • Catches Errors Before they become Fatal
  • 0 Dependencies
  • Typescript Support

Install 🛠

npm install xrays

Usage 🔭

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') }

Documentation 🛰

xrays is under active development, documentation will be added once an initial release is ready.

Contributing 🌎

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.

License ⚖️

MIT