exists

v1.0.0
exists and allExist functions. plain and simple
exists exist util check utils undefined null allExist allExists and 1 more...

exists

node exists function. plain and simple.

exists(thing)

returns true for anything other than null or undefined

var exists = require('exists');

exists(null);      // false
exists(undefined); // false
exists({});        // true
exists([]);        // true
exists('');        // true
exists(false);     // true

exists.allExist(thing)

returns true if all arguments are not null or undefined

var allExist = require('exists').allExist;

allExist(null, undefined);   // false
allExist({}, [], '', false); // true
allExist({}, null)  ;        // false

License

MIT

Metadata

  • MIT
  • Whatever
  • Tejesh Mehta
  • released 3/28/2014

Downloads

Maintainers