JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q33502F
  • License MIT

Pico-scale assertion module

Package Exports

  • picoassert

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (picoassert) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

picoassert

Perhaps the smallest Javascript assertion module

picoassert is a 157-byte Javascript assertion module. It is based on nanoassert.

Usage

var assert = require("picoassert")

assert.equal(a, b, `${a} == ${b}`);
assert.notEqual(a, b, `${a} != ${b}`);
assert.truthy(a, `(!!${a}) === true`);

Why

The nanoassert repository README describes the author's complaint about the excessive size of the assert module, the standard assertion library. However, even the nanoassert library was unnecessarily large, which led to the creation of picoassert.

This library is also an open golf challenge. Please feel free to submit pull requests if you're able to shorten the code!

Install

npm install picoassert

License

Please see the LICENSE file for license information.