2.0.0 • Published 7 years ago

nanoassert v2.0.0

Weekly downloads
88,849
License
ISC
Repository
github
Last release
7 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-diyahyperconsolehypercore-upload-serverhypercore-multiparthypercore-on-the-rockshyperdispatchiambushash-chainhmac-blake2bhandshake-peerinterchange-file-formatlittle-process-boxmediaxmllowdb-gh-adaptermagniid@vegaprotocol/crypto@truework/sdk@ungoldman/component@vegaprotocol/snapabstract-routerabstract-viewsaws-s3-object-multipart-copyautobaseautemvoluptatibusanimation-toolboxargon2hash-wasmfun-component@tavexit/nemid@tatsujoestar/blake2b@tatsujoestar/blake2b-wasmearumsiteff-diceware-passphraseencrypted-json-protocoleth-tweak-keyeth-serdeeth-signestree-assign-parenteth-helperseth-create2eth-keygenfeathers-slugifyfacerevoluptatem@12core/varint-wasm@3-/proto@proseline/crypto@bitgo-beta/blake2b@bitgo-beta/blake2b-wasm@bitgo/blake2b@bitgo/blake2b-wasm@backbonedao/noise-handshakechacha20-universalchoo-streamdata.iochoo-toolcommonform-commonmarkcesium-cartographicchoo-resourcechoochoo-analyticschoo-breakcommonmark-to-commonformcomponent-boxclass-cachecordova-plugin-android-downloadmanagercordova-mobilepay-appswitchdepth-first-mapblake2bblake2b-no-wasmblake2b-streamblake2b-wasmbasic-noisebase64-wasmbip39-mnemonicbitcoind-coinbase-testbtc-script-helpersbtc-script-utilsbuffer-urlencodedbitcoin-consensus-encodingbitcoin-test-utilbiguintbebiguintle@arve.knudsen/fun-component@aloe2/blake2b@aloe2/blake2b-wasmstochastic-access-idbspake2-ee
2.0.0

7 years ago

1.1.0

8 years ago

1.0.0

8 years ago