New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

xrays

Package Overview
Dependencies
Maintainers
1
Versions
389
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xrays

Catch Errors before they become Fatal

latest
Source
npmnpm
Version
1.0.388
Version published
Maintainers
1
Created
Source

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

Keywords

error handling

FAQs

Package last updated on 29 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts