xrays
TypeScript icon, indicating that this package has built-in type declarations

1.0.388 • Public • Published

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

Package Sidebar

Install

npm i xrays

Weekly Downloads

1

Version

1.0.388

License

MIT

Unpacked Size

16.8 kB

Total Files

6

Last publish

Collaborators

  • a-n-u-b-i-s