Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

console-assert

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

console-assert

Standardizer for node's console.assert

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

console-assert

Simple console.assert polyfill for node since existing realization throws instead of printing error.

See:

  • Issue in nodejs repository: https://github.com/nodejs/node/issues/5340
  • Draft specification: https://github.com/DeveloperToolsWG/console-object/blob/master/api.md#consoleassertexpression-object

Why?

Because when you trying to write polymorphic code you can't use console.assert in node env.

How to use?

Install module via npm:

npm i console-assert

Write this somewhere when you need it:

require('console-assert').browserify();

NB: Module patchs global console.assert and if you need to rollback behaviour you have to just run require('console-assert').restore();.

License

The MIT License

Keywords

FAQs

Package last updated on 24 Mar 2016

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