Skip to content

Commit

Permalink
Bump version 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeep committed Apr 29, 2024
1 parent 112861a commit 080b035
Show file tree
Hide file tree
Showing 35 changed files with 6,364 additions and 1 deletion.
408 changes: 408 additions & 0 deletions docs/@kabeep/exception/1.0.3/Exception.html

Large diffs are not rendered by default.

672 changes: 672 additions & 0 deletions docs/@kabeep/exception/1.0.3/PaletteError.html

Large diffs are not rendered by default.

1,315 changes: 1,315 additions & 0 deletions docs/@kabeep/exception/1.0.3/PrintError.html

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
204 changes: 204 additions & 0 deletions docs/@kabeep/exception/1.0.3/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="en">
<head>

<meta charset="utf-8">
<title>Home - Documentation</title>


<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav >


<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Exception.html">Exception</a><ul class='methods'><li data-type='method'><a href="Exception.html#toString">toString</a></li></ul></li><li><a href="PaletteError.html">PaletteError</a><ul class='methods'><li data-type='method'><a href="PaletteError.html#factory">factory</a></li><li data-type='method'><a href="PaletteError.html#palette">palette</a></li></ul></li><li><a href="PrintError.html">PrintError</a><ul class='methods'><li data-type='method'><a href="PrintError.html#calc">calc</a></li><li data-type='method'><a href="PrintError.html#closing">closing</a></li><li data-type='method'><a href="PrintError.html#divide">divide</a></li><li data-type='method'><a href="PrintError.html#highlight">highlight</a></li><li data-type='method'><a href="PrintError.html#opening">opening</a></li><li data-type='method'><a href="PrintError.html#print">print</a></li></ul></li></ul>

</nav>

<div id="main">









<section class="package">
<h3>@kabeep/exception 1.0.3</h3>
</section>













<section class="readme usertext">
<article><h1>expection</h1>
<div align="center">
<img src="docs/images/logo-dark.png" alt="logo-dark">
<p>Exception is a custom error library for Node.js that provides a more flexible and customizable way of handling errors.</p>
<hr>
<p><img src="https://img.shields.io/badge/NodeJS-%E2%89%A514.x-lightseagreen?logo=powershell" alt="nodejs">
<img src="https://img.shields.io/badge/Version-1.0.0-cornflowerblue" alt="Version">
<a href="https://codecov.io/gh/kabeep/exception"><img src="https://codecov.io/gh/kabeep/exception/graph/badge.svg?token=KZH2CVD2CD" alt="codecov"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-slateblue" alt="License"></a></p>
<p>English | <a href="README.zh-CN.md">简体中文</a></p>
</div>
<h2>📖 Introduction</h2>
<blockquote>
<p>Inspired by the work of <a href="https://github.com/sindresorhus">sindresorhus</a>, I decided to open source the most repetitive
encapsulation work I do in CLI development.</p>
</blockquote>
<p>I do not like disorder. Often, unexpected situations arise due to our insufficient consideration. Therefore, I encourage
those around me to engage in more comprehensive error collection work.</p>
<p>The goal of Exception is to transform unexpected occurrences into anticipated outcomes as much as possible.</p>
<p>It allows Error objects to throw exception and stack information in a more aesthetically pleasing and intuitive manner,
and can also serve as Notify to output critical information in workflows.</p>
<div align="center">
<img src="docs/images/class-inheritance.png" alt="inheritance-tree" width="200">
<p>class-inheritance</p>
</div>
<h2>⚙️ Installation</h2>
<pre class="prettyprint source lang-bash"><code>npm install @kabeep/exception --save
</code></pre>
<pre class="prettyprint source lang-bash"><code>yarn add @kabeep/exception
</code></pre>
<pre class="prettyprint source lang-bash"><code>pnpm add @kabeep/exception
</code></pre>
<h2>🚀 Usage</h2>
<h3>Plain text or Error object</h3>
<p><a href="example/default.ts">example</a></p>
<pre class="prettyprint source lang-javascript"><code>import Exception from '@kabeep/exception';

// Plain text
throw new Exception('Argument example');

// or Error object
throw new Exception(new Error('Argument example'));
</code></pre>
<h3>Using in Asynchronous Contexts</h3>
<p><a href="example/promise.ts">example</a></p>
<pre class="prettyprint source lang-javascript"><code>import Exception from '@kabeep/exception';

(
async () => {
throw new Exception('Promise example');
}
)().catch(console.log);
</code></pre>
<h3>Custom Styles</h3>
<p><a href="example/stylish.ts">example</a></p>
<pre class="prettyprint source lang-javascript"><code>import Exception from '@kabeep/exception';

// Use custom style with chalk color, hex and rgb
const stylish = ['51,51,51', 'bg:#f56c6c']

console.log(
new Exception('Stylish example', stylish)
);
</code></pre>
<h3>Custom Exceptions</h3>
<p><a href="example/extends.ts">example</a></p>
<pre class="prettyprint source lang-javascript"><code>import Exception from '@kabeep/exception';

// > Warning
class Warning extends Exception {
constructor (message: any) {
super(message, [' 51,51,51 ', 'bg:#e6a23c']);
}
}

const warn = new Warning('Inherited example');
// Warning: Inherited example [Without style]
console.log(`${warn}`);
</code></pre>
<h3>Print Key Information</h3>
<p><a href="example/extends.ts">example</a></p>
<pre class="prettyprint source lang-javascript"><code>import Exception from '@kabeep/exception';

// > Info
class Info extends Exception {
constructor (message: any) {
super(message, ['51,51,51', 'bg:#409eff']);
}

toString () {
return ` ${this.palette(['51,51,51', 'bg:#409eff'])(this.name)} ${this.message}`;
}
}

const tip = new Info('Inherited example');
// Without stack
console.log(`${tip}`);

// > Success
class Success extends Exception {
constructor (message: any) {
super(message, ['51,51,51', 'bg:#67c23a']);
}

toString () {
return ` ${this.palette(['51,51,51', 'bg:#67c23a'])(this.name)} ${this.message}`;
}
}

const pass = new Success('Inherited example');
// Without stack
console.log(pass.toString());
</code></pre>
<h2>🤝 Contribution</h2>
<p>Contributions via Pull Requests or <a href="https://github.com/kabeep/exception/issues">Issues</a> are welcome.</p>
<h2>📄 License</h2>
<p>This project is licensed under the MIT License. See the <a href="LICENSE">LICENSE</a> file for details.</p></article>
</section>








</div>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Apr 29 2024 19:18:12 GMT+0800 (中国标准时间) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>



</body>
</html>
Loading

0 comments on commit 080b035

Please sign in to comment.