Back to integrations
Add your integration
  • ⭐️ Popular
  • 🧩 Essentials
  • 🛠 Code
  • ⚡️ Data & state
  • ✅ Test
  • 💅 Style
  • 🎨 Design
  • ⚙️ Appearance
  • 🗄 Organize
How to install addons Create an addon
Null generator library
npm install null
Last updated almost 5 years ago
Downloads per week
Readme View on GitHub


Null all of the things! This package was originally created as a joke, but hey now it actually does something non-trivial.

If you ever use null for logic tests, you can try using a Symbol instead via the NullRef library provided by this package.

This package provides for a NULL constant that is a Symbol from the Global Symbol Registry, as well as convenience methods for testing, casting, and comparing values.


Require and reference what you need:

const nullref   = require('null'); // note that the variable name should not be null, here we use nullref
const nulltest  = nullref.lib; // load the full library of convenience features

const isNull    = nullref.isNull // or just load the main ones you want (checks for null or NULL)
const isNullRef = nullref.isNullRef // checks for NULL only

const NULL = nullref(); // NULL symbol instance (singleton);

Consume and use as needed.

let x = null;

//returns true is x is null or NULL
if( ) //do something

if( isNull(x) ) // same as above

//cast a variable to NULL if it is null or NULL
if( NULL === ) // do something
Join the community
6,588 developers and counting
WhyWhy StorybookComponent-driven UI
CommunityAddonsGet involvedBlog
ShowcaseExploreProjectsComponent glossary
Open source software

Maintained by
Special thanks to Netlify and CircleCI