assert-fn

1.0.1 • Public • Published

assert-fn

A very simple alternative to the built-in node:assert module. All assert-fn does is check if the condition is not true, and if it is not true, throw an error. The below code throws no error:

const assert = require('assert-fn')
assert(2   2 === 4, "no error")

But this code throws an error:

const assert = require('assert-fn')
assert(2   2 === 5, "error") // AssertionError: Assertion failed: error

Readme

Keywords

none

Package Sidebar

Install

npm i assert-fn

Weekly Downloads

4

Version

1.0.1

License

UNLICENSED

Unpacked Size

1.3 kB

Total Files

3

Last publish

Collaborators

  • 87f-