Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 23, 2024 via pnpm

assert-plus 0.1.0

Extra assertions on top of node's assert module
Package summary
Share
2
issues
1
critical severity
license
1
1
moderate severity
meta
1
1
license
1
N/A
Package created
23 Jun 2012
Version published
23 Jun 2012
Maintainers
7
Total deps
1
Direct deps
0
License
UNKNOWN

Issues

2

1 critical severity issue

critical
Recommendation: Check the package code and files for license information
via: assert-plus@0.1.0
Collapse
Expand

1 moderate severity issue

moderate
via: assert-plus@0.1.0
Collapse
Expand

Licenses

N/A

N/A
1 Packages, Including:
assert-plus@0.1.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of assert-plus 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does assert-plus do?

Assert-plus is a lightweight library offering enhanced features over Node's assert module. The module brings two extended functionalities, the environment variable NODE_NDEBUG that allows users to disable assertions, and API wrappers such as assert.string(myArg, 'myArg') that are designed for argument testing, improving the validation process within your code.

How do you use assert-plus?

Utilizing assert-plus involves straightforward means and requires minimal effort. The first step is to install the package through npm using npm install assert-plus. You can use it within your JavaScript function like so:

    var assert = require('assert-plus');

    function fooAccount(options, callback) {
        assert.object(options, 'options');
        assert.number(options.id, 'options.id');
        assert.bool(options.isManager, 'options.isManager');
        assert.string(options.name, 'options.name');
        assert.arrayOfString(options.email, 'options.email');
        assert.func(callback, 'callback');

        // Do stuff
        callback(null, {});
    }

In this code, we're utilizing assert-plus to ensure that the correct types are passed to a function. If the wrong type is passed, an AssertionError will be thrown.

Where are the assert-plus docs?

The comprehensive and updated documentation for assert-plus is hosted within the Readme file on the GitHub repository at https://github.com/mcavage/node-assert-plus. Here you'll find details about the API, installation guides, and code usage examples for each category of assertions provided by this powerful module.