npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

exists

1.0.1 • Public • Published

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

install

npm i exists

Downloadsweekly downloads

552

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability