is-empty
Check whether a value is "empty".
Last updated 8 years ago by ianstormtaylor .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install is-empty 
SYNC missed versions from official npm registry.

is-empty

Check whether a value is empty.

Installation

$ npm install is-empty
$ npm test

Example

var empty = require('is-empty');

empty([]);              // true
empty({});              // true
empty('');              // true
empty(0);               // true
empty(function(){});    // true
empty(null);            // true
empty(undefined);       // true
empty(new Map());       // true
empty(new Set());       // true
empty(new Error());     // true

empty(true);            // false
empty(false);           // false
empty(['a', 'b']);      // false
empty({ a: 'b' });      // false
empty('string');        // false
empty(42);              // false
empty(function(a,b){}); // false
empty(new Map([['key', 'value']])); // false
empty(new Set([1]));    // false
empty(new Error('fail'))// false

API

isEmpty(value)

Check whether value is empty.

License

MIT

Current Tags

  • 1.2.0                                ...           latest (8 years ago)

5 Versions

  • 1.2.0                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
  • 0.0.1                                ...           11 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |