@duskit/error

Functions for creating and managing errors.
TOC
Dev environment
The dev environment assumes that you have at least Node.js v22.11.0 installed. The LTS version is 22.11.0 at the time of writing.
This package is part of the Duskit monorepo.
Please refer to the main README for monorepo usage, changeset management and installation of dependencies.
[back to TOC]
Installation and usage
Install it with your favourite package manager:
npm install @duskit/error --save
Import the functions you need:
import { getErrorFrom } from "@duskit/error";
getErrorFrom("invalid data");
[back to TOC]
NPM scripts
npm run checks
- runs all health checks (formatting, linting, type checking, tests)
npm run clean
- removes the coverage
, docs
and node_modules
folders
npm run docs
- generates the HTML documentation in the docs
folder
npm run format
- fixes the formatting in all files
npm run format:check
- performs the formatting check
npm run lint
- performs the linting check
npm run lint:fix
- fixes, where possible, linting errors
npm run test
- runs the test suite
npm run test:coverage
- runs the test suite and generates the code coverage report in the coverage
folder
npm run test:watch
- runs the test suite in watch mode
npm run typecheck
- runs the type checker
npm run typecheck:watch
- runs the type checker in watch mode
[back to TOC]