Socket
Socket
Sign inDemoInstall

run-time-error-cjs

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-time-error-cjs

A better error that is inspired by the Java exception that is also serializable to JSON.


Version published
Weekly downloads
592
decreased by-39.28%
Maintainers
1
Install size
16.8 kB
Created
Weekly downloads
 

Changelog

Source

1.4.0 - 2021-05-16

Added

  • Introduced ESM and UMD versions of this module, each with an ES5 version for browser environments.

Changed

  • Removed unnecessary files from the package making it more lightweight.
  • Moved to named exports, so importing this should now look like this:
    import { RuntimeError } from 'run-time-error';
    // instead of
    import RuntimeError from 'run-time-error';
    

Readme

Source

RuntimeError

Available from NPM Built using GitHub Action

A better error that is inspired by the Java exception that is also serializable to JSON.

Usage

import { RuntimeError } from 'run-time-error';

try
{
  throw new Error('The root cause error.');
}
catch (cause)
{
  throw new RuntimeError('An unexpected error occurred while performing an operation.', cause);
}

This module can also be treated as a CommonJS module:

const { RuntimeError } = require('run-time-error');

Getting started

This project is available through the Node Package Manager (NPM), so you can install it like so:

npm install run-time-error

Please Note: Versions of Node lower than v12.0.0 are not supported.

Development

Building

You can build UMD and ESM versions of this module that are minified:

npm run build

Testing

This module also has a robust test suite:

npm test

This also runs code quality checks using ESLint. Please refer to the .eslintrc files to familiar yourself with the rules.

License

This project is released under the MIT license.

Keywords

FAQs

Last updated on 27 Oct 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc