🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

empty-php

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empty-php

Exact replica of the PHP empty function in for JavaScript and TypeScript

latest
Source
npmnpm
Version
3.1.0
Version published
Maintainers
1
Created
Source

Empty PHP

Build Status

The purpose of this library is to be a zero dependency and exact replica of the PHP empty function.

According to the PHP documentation, the following values are considered to be empty:

  • "" (an empty string)
  • 0 (0 as an integer)
  • 0.0 (0 as a float)
  • "0" (0 as a string)
  • NULL
  • FALSE
  • array() (an empty array)

Installation

Install with your favorite package manager:

npm install --save empty-php

Usage

To use the library:

import { empty } from "empty-php";

if (empty(myVar)) {
    // It's empty
}

Versioning

This project complies with Semantic Versioning.

Changelog

For a complete list of changes, and how to migrate between major versions, see releases page.

Keywords

empty

FAQs

Package last updated on 26 Nov 2025

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