<commit_before>[![Coveralls – test coverage
](https://img.shields.io/coveralls/studio-b12/tiny-error.svg?style=flat-square)
](https://coveralls.io/r/studio-b12/tiny-error)
 [![Travis – build status
](https://img.shields.io/travis/studio-b12/tiny-error/master.svg?style=flat-square)
](https://travis-ci.org/studio-b12/tiny-error)
 [![David – status of dependencies
](https://img.shields.io/david/studio-b12/tiny-error.svg?style=flat-square)
](https://david-dm.org/studio-b12/tiny-error)
 [![Code style: airbnb
](https://img.shields.io/badge/code%20style-airbnb-blue.svg?style=flat-square)
](https://github.com/airbnb/javascript)
 [![Stability: experimental
](https://img.shields.io/badge/stability-experimental-yellow.svg?style=flat-square)
](https://nodejs.org/api/documentation.html#documentation_stability_index)




tiny-error
==========

**Super-light error objects.**

This library is inspired by error handling in *go*. I’m no expert with *go*, but I’ve heard two things:

* *Go* has no heavy try/catch mechanism. We all know that try/catch in JS is [slowish](https://jsperf.com/try-catch-performance-overhead) – and [you can well do without it](http://stackoverflow.com/a/3217308/2816199).
* *Go* has no heavy stack traces in errors. They also bring [overhead](http://jsperf.com/new-error-vs-custom-error-object) in JavaScript. And, if you ask me, I definitely prefer a readable error message than a stack trace with umpteen calls to dig through.

Since *go* programmers like it so, why not try lightweight errors in JavaScript?


**⚠ Heads up!** This is totally a work in progress. [Thoughts and ideas][] are very welcome.

[Thoughts and ideas]:  https://github.com/studio-b12/tiny-error/issues




Installation
------------

```sh
$ npm install tiny-error
```




Usage<commit_msg>Update the readme<commit_after>[![Coveralls – test coverage
](https://img.shields.io/coveralls/studio-b12/tiny-error.svg?style=flat-square)
](https://coveralls.io/r/studio-b12/tiny-error)
 [![Travis – build status
](https://img.shields.io/travis/studio-b12/tiny-error/master.svg?style=flat-square)
](https://travis-ci.org/studio-b12/tiny-error)
 [![David – status of dependencies
](https://img.shields.io/david/studio-b12/tiny-error.svg?style=flat-square)
](https://david-dm.org/studio-b12/tiny-error)
 [![Code style: airbnb
](https://img.shields.io/badge/code%20style-airbnb-blue.svg?style=flat-square)
](https://github.com/airbnb/javascript)
 [![Stability: experimental
](https://img.shields.io/badge/stability-experimental-yellow.svg?style=flat-square)
](https://nodejs.org/api/documentation.html#documentation_stability_index)




tiny-error
==========

**Super-light error objects.** Inspired by *go*.

I’m no expert with *go*, but I’ve heard two things:

* *Go* has no heavy try/catch mechanism. We all know that try/catch in JS is [slowish](https://jsperf.com/try-catch-performance-overhead) – and you can [do well](http://stackoverflow.com/a/3217308/2816199) without it.
* *Go* has no heavy stack traces in errors. They also bring [overhead](http://jsperf.com/new-error-vs-custom-error-object) in JavaScript. And, if you ask me, I definitely prefer a readable error message than a stack trace with umpteen calls to dig through.

Since *go* programmers like it so, why not try lightweight errors in JavaScript?


**⚠ Heads up!** This is totally a work in progress. [Thoughts and ideas][] are very welcome.

[Thoughts and ideas]:  https://github.com/studio-b12/tiny-error/issues




Installation
------------

```sh
$ npm install tiny-error
```




Usage
{'fraction_non_alphanumeric': 0.163943661971831, 'fraction_numerical': 0.016901408450704224, 'mean_word_length': 4.5054263565891475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 24, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3764628', 'n_tokens_mistral': 1276, 'n_tokens_neox': 1193, 'n_words': 293}