https://github.com/cnpm/errors
cnpm errors
https://github.com/cnpm/errors
Last synced: 4 months ago
JSON representation
cnpm errors
- Host: GitHub
- URL: https://github.com/cnpm/errors
- Owner: cnpm
- License: mit
- Created: 2022-08-05T13:03:32.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-18T14:46:50.000Z (over 3 years ago)
- Last Synced: 2025-10-19T00:29:38.742Z (8 months ago)
- Language: TypeScript
- Size: 43.9 KB
- Stars: 4
- Watchers: 14
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
npm i -S @cnpmjs/errors
```
# Usage
1. JS Code sample
```javascript
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());
```
2. Error configuration
Checkout the [example folders](./example) or integration tests for full usage showcase.