New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

is-empty-input

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-empty-input

A simple package to check if input is null, undefined, or an empty string

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

📦 is-empty-input

npm version license

A simple Node.js package that checks whether a given input is null, undefined, an empty string, an empty array, or an empty object. This package is useful for basic input validation in JavaScript projects.

🚀 Installation

To install the package in your project, use npm:

npm install is-empty-input

✨ Usage

After installation, you can import the package into your JavaScript files and use it to check input values. Here are some examples:

const isEmptyInput = require('is-empty-input');

// These should return true
console.log(isEmptyInput(null)); // true
console.log(isEmptyInput(undefined)); // true
console.log(isEmptyInput('')); // true
console.log(isEmptyInput('   ')); // true
console.log(isEmptyInput([])); // true
console.log(isEmptyInput({})); // true

// These should return false
console.log(isEmptyInput('hello')); // false
console.log(isEmptyInput([1, 2, 3])); // false
console.log(isEmptyInput({ key: 'value' })); // false
console.log(isEmptyInput(0)); // false


Connect With Me - Harsh Gupta

Keywords

validation

FAQs

Package last updated on 02 Jun 2024

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