<commit_before># krash
fluent assert for validation of invariants before assignment.

[![NPM](https://nodei.co/npm/krash.png?compact=true)](https://nodei.co/npm/krash/)
[![build status](https://secure.travis-ci.org/bzb-stcnx/yalookup.png)](http://travis-ci.org/bzb-stcnx/yalookup)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

# motivation
bare-bones inline assertion of invariants when assigning a value to a variable (detailed [example](#usage) below)
```javascript
var delicate = krash.unless(suspect, isDefined, 'suspect not defined')
```
particularly helpful together with your favorite library of predicates such as 
[lodash/Lang](https://www.npmjs.com/package/lodash),
[predicate](https://www.npmjs.com/package/predicate),
[predicates](https://www.npmjs.com/package/predicates), ...

# usage
## example
```javascript
var krash = require('krash')<commit_msg>correct cut/paste error on build badge<commit_after># krash
fluent assert for validation of invariants before assignment.

[![NPM](https://nodei.co/npm/krash.png?compact=true)](https://nodei.co/npm/krash/)
[![build status](https://secure.travis-ci.org/bzb-stcnx/krash.png)](http://travis-ci.org/bzb-stcnx/krash)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

# motivation
bare-bones inline assertion of invariants when assigning a value to a variable (detailed [example](#usage) below)
```javascript
var delicate = krash.unless(suspect, isDefined, 'suspect not defined')
```
particularly helpful together with your favorite library of predicates such as 
[lodash/Lang](https://www.npmjs.com/package/lodash),
[predicate](https://www.npmjs.com/package/predicate),
[predicates](https://www.npmjs.com/package/predicates), ...

# usage
## example
```javascript
var krash = require('krash')
{'fraction_non_alphanumeric': 0.16709777547853077, 'fraction_numerical': 0.0020693222969477496, 'mean_word_length': 5.882562277580071, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 6, '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': '691474', 'n_tokens_mistral': 684, 'n_tokens_neox': 619, 'n_words': 120}