Skip to content

cnpm/errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f890eef · Dec 18, 2022

History

21 Commits
Dec 18, 2022
Aug 26, 2022
Sep 6, 2022
Sep 6, 2022
Aug 17, 2022
Dec 18, 2022
Sep 27, 2022
Aug 5, 2022
Aug 26, 2022
Aug 17, 2022
Dec 18, 2022
Aug 22, 2022

Repository files navigation

What

cnpm errors. A framework aiming at automatically fixing user falsies.

Why

Normally when coming across a misuse of framework, the framework developer tends to print a message to inform users the right way.

This framework provides a way to automatically fix misuses. Both framework developers and users should save their lives when things could be done with codes.

Installation

npm i -S @cnpmjs/errors

Usage

  1. JS Code sample
const { ErrorRunner, ErrorEnum } = require('@cnpmjs/errors');
const error = new ErrorRunner({
  path: path.join('/path/to/your/error/folder'), // error config folders
  lang: 'zh-cn', // i18n
  loglevel: ErrorEnum.Info, // global error level
});

// run customized error
await error.test(new CustomizedError());
  1. Error configuration Checkout the example folders or integration tests for full usage showcase.