npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

assert-x

v3.2.2

Published

A Javascript assertion library.

Readme

assert-x

A Javascript assertion library.

See: https://nodejs.org/dist/latest-v12.x/docs/api/assert.html

This is legacy mode by default.

See:https://nodejs.org/dist/latest-v12.x/docs/api/assert.html#assert_legacy_mode

Strict mode is available.

See: https://nodejs.org/dist/latest-v12.x/docs/api/assert.html#assert_strict_mode

assert-x~AssertionError ⇐ Error

Kind: inner class of assert-x
Extends: Error

new AssertionError([message])

Error constructor for test and validation frameworks that implement the standardized AssertionError specification.

| Param | Type | Description | | --------- | ------------------- | -------------------------------- | | [message] | Object | Need to document the properties. |

assert-x~deepEqual

Tests for deep equality, coercive equality with the equal comparison operator ( == ) and equivalent.

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~deepStrictEqual

Tests for deep equality, coercive equality with the equal comparison operator ( === ) and equivalent.

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~doesNotThrow

Expects block not to throw an error, see assert~throws for details.

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------------ | --------------------------------------------- | | block | function | The function block to be executed in testing. | | [error] | constructor | The comparator. | | [message] | string | Text description of test. |

assert-x~equal

Tests shallow, coercive equality with the equal comparison operator ( == ).

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~fail

Throws an exception that displays the values for actual and expected separated by the provided operator.

Kind: inner property of assert-x
Throws:

  • Error Throws an AssertionError.

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. | | operator | string | The compare operator. |

assert-x~ifError

Tests if value is not a falsy value, throws if it is a truthy value. Useful when testing the first argument, error in callbacks.

Kind: inner property of assert-x
Throws:

  • * The value err if truthy.

| Param | Type | Description | | ----- | --------------- | -------------------------------------- | | err | * | The value to be tested for truthiness. |

assert-x~notDeepEqual

Tests for any deep inequality. Opposite of deepEqual.

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~notDeepStrictEqual

Tests for deep inequality. Opposite of deepStrictEqual.

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~notEqual

Tests shallow, coercive non-equality with the not equal comparison operator ( != ).

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~notStrictEqual

Tests strict non-equality, as determined by the strict not equal operator ( !== ).

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~ok

Tests if value is truthy, it is equivalent to equal(!!value, true, message).

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | ------------------------- | | value | * | The value to be tested. | | [message] | string | Text description of test. |

assert-x~strictEqual

Tests strict equality, as determined by the strict equality operator ( === ).

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------- | --------------------------------------------- | | actual | * | The actual value to be tested. | | expected | * | The expected value to compare against actual. | | [message] | string | Text description of test. |

assert-x~throws

Expects block to throw an error. error can be constructor, regexp or validation function.

Kind: inner property of assert-x

| Param | Type | Description | | --------- | ------------------------------------------------------------------------ | --------------------------------------------- | | block | function | The function block to be executed in testing. | | [error] | constructor | RegExp | function | The comparator. | | [message] | string | Text description of test. |

assert-x~$assert(value, message)

Tests if value is truthy, it is equivalent to equal(!!value, true, message).

Kind: inner method of assert-x

| Param | Type | Description | | ------- | ------------------- | ------------------------- | | value | * | The value to be tested. | | message | string | Text description of test. |