2.0.0 • Published 6 years ago

nanoassert v2.0.0

Weekly downloads
88,849
License
ISC
Repository
github
Last release
6 years ago

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

@infinitebrahmanuniverse/nolb-nan@everything-registry/sub-chunk-2244@itoa/app-graphql@itoa/auth-passport@itoa/fields-contenttape-paritysync-cordova-xmlsync-cordova-xml2tail-bytes-streamteneturvoluptatemwire-encoderweb-audio-graphtemp-ks-app-graphqlstable-streamtestlib02lavana-diyastochastic-access-idbspake2-eetwitter-componenttiny-module-compiler@arve.knudsen/fun-component@aloe2/blake2b@aloe2/blake2b-wasm@backbonedao/noise-handshake@bitgo-beta/blake2b@bitgo-beta/blake2b-wasm@bitgo/blake2b@bitgo/blake2b-wasm@12core/varint-wasm@3-/protoyoutube-componentwat-tokenizerwayfarerunpacker-with-progress@harrier_/noise-js@emilbayes/multiset@gemlink/blake2b@geut/blake2b@geut/sha512-wasm@geut/socketich-client@likecoin/noise-js@little-core-labs/varint-wasm@loll/component@mafintosh/streamx@niomon/ditto-js@niomon/noise-js@noaignite-dk/nemid@keystonejs/auth-passport@keystonejs/fields-content@j.balek/vegasnap@koikorn/app-graphql@koikorn/auth-passport@koikorn/field-content@keystone-alpha/auth-passport@keystone-alpha/field-content@keystone-alpha/passport-auth@keystone-alpha/app-graphql@keystone-next/fields-content-legacy@keystonejs/app-graphql@hyperdivision/ui@hyperdivision/eth-multisig-wallet@hyperdivision/heimdall@hyperdivision/heimdall-plugins@hyperdivision/heimdall-profile@hyperdivision/murmur3hash-wasm@hyperdivision/nanomorph@hyperdivision/password-encrypted-container@hyperdivision/pin-peer@hyperdivision/shielded-multisig@keystone-next/app-graphql-legacy@keystone-next/auth-passport-legacy@proseline/cryptomultisig-hmacmurmur3hash-wasmmodern-asyncnanoquerynanorafnanoanimationnanobusnanochoonanocomponentnanostatenanoprocessnanoresource-readynanorouternanotimingnanoschedulernanomorphnanolocationnanomapnanofetchernanohrefnanohtmlon-performanceon-idleon-loadpassword-encrypted-containerpassword-encrypted-overlaysedametsecret-blob
2.0.0

6 years ago

1.1.0

8 years ago

1.0.0

8 years ago