nanoassert

WebJar for nanoassert

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

nanoassert
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

nanoassert
WebJar for nanoassert
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/emilbayes/nanoassert

Download nanoassert

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/nanoassert/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>nanoassert</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/nanoassert/
implementation 'org.webjars.npm:nanoassert:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/nanoassert/
implementation ("org.webjars.npm:nanoassert:1.1.0")
'org.webjars.npm:nanoassert:jar:1.1.0'
<dependency org="org.webjars.npm" name="nanoassert" rev="1.1.0">
  <artifact name="nanoassert" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='nanoassert', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "nanoassert" % "1.1.0"
[org.webjars.npm/nanoassert "1.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

nanoassert

Build Status

Nanoscale assertion module

Usage

var assert = require('nanoassert')

assert(a !== b, `${a} !== ${b}`)

API

assert(declaration, [message])

Assert that declaration is truthy otherwise throw AssertionError with optional message. In Javascript runtimes that use v8, you will get a nicer stack trace with this error. If you want friendlier messages you can use template strings to show the assertion made like in the example above.

Why

I like to write public facing code very defensively, but have reservations about the size incurred by the assert module. I only use the top-level assert method anyway.

nanoassert@^1.1.0

Docs for the previous version, which is used by many modules on npm, can be found here

Install

npm install nanoassert

License

ISC

Versions

Version
1.1.0