@the-/assert

15.4.1 • Public • Published

@the-/assert

npm Version

Assert for the-framework

Installation

$ npm install @the-/assert --save

Usage

'use strict'

const { TheAssert } = require('@the-/assert')

async function tryExample() {
  const assert = new TheAssert('MyApp') //

  function sum(a, b) {
    assert(arguments.length > 0, 'must take two arguments')
    return a + b
  }

  sum() // -> new Error(`[MyApp] must take two arguments`)
}

tryExample().catch((err) => console.error(err))

API Guide

function

class

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i @the-/assert

Weekly Downloads

31

Version

15.4.1

License

MIT

Unpacked Size

39.5 kB

Total Files

25

Last publish

Collaborators

  • okunishinishi