Socket
Socket
Sign inDemoInstall

hey-listen

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hey-listen

Warning and invariant dev-ex messaging.


Version published
Weekly downloads
1.7M
increased by2.44%
Maintainers
1
Install size
9.46 kB
Created
Weekly downloads
 

Package description

What is hey-listen?

The hey-listen npm package is a collection of utility functions designed to help developers with warning and invariant messages. It is often used to provide development-time checks and informative messages to developers, ensuring that they are using APIs or components correctly and are aware of any misuse or potential issues.

What are hey-listen's main functionalities?

warning

The 'warning' function is used to display warning messages in the console when a certain condition is not met. It is useful for alerting developers of potential issues during development.

import { warning } from 'hey-listen';

// Check if a condition is met and warn if not
warning(condition, 'This is a warning message if the condition is false.');

invariant

The 'invariant' function is used to enforce a condition. If the condition is not met, it throws an error. This is useful for ensuring that certain conditions are met before proceeding with code execution.

import { invariant } from 'hey-listen';

// Check if a condition is met and throw an error if not
invariant(condition, 'This error is thrown if the condition is false.');

Other packages similar to hey-listen

Readme

Source

Hey, Listen!

Dev-ex warning functions with added childhood flashbacks

npm version npm downloads Twitter Follow Join the community on Spectrum

Hey, Listen! provides simple versions of the popular warning and invariant dev-experience functions.

The library checks against process.env.NODE_ENV to minify away messages in production.

Install

npm

npm install hey-listen

Yarn

yarn add hey-listen

Usage

warning

import { warning } from 'hey-listen';

warning(false, 'Warning message'); // console.warn "Warning message"

invariant

import { invariant } from 'hey-listen';

invariant(false, 'Error message'); // throws "Error message"

Keywords

FAQs

Last updated on 11 Apr 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc