Socket
Socket
Sign inDemoInstall

@brillout/libassert

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brillout/libassert

Assertions for library authors.


Version published
Weekly downloads
4.1K
decreased by-30.52%
Maintainers
1
Weekly downloads
 
Created
Source

Minimalistic & simple assertions for library authors.

For example:

import { assertUsage, setProjectInfo } from @brillout/libassert;

export { hello };

setProjectInfo({
  projectName: 'Awesome Library',
});

function hello(name) {
  assertUsage(name, "Missing argument `name`.");
}

If your user calls hello() without arguments then assertUsage throws following error:

Error: [Awesome Library][Wrong Usage] Missing argument `name`.
    at main (/home/your-user/app/index.js:249:1)

Check the (small) source code for more information.

FAQs

Package last updated on 26 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc