Skip to content

jsmicro/is-empty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSMicro - Is Empty

isEmpty(object)

Check does the given Javascript Object (array, object, string, etc) is empty.

isNotEmpty(object)

Check does the given Javascript Empty (array, object, string, etc) is not empty.

Browser Usage

bower install --save jsmicro-is-empty
<script type="text/javascript" src="bower_components/jsmicro-is-empty/index.js">
<script type="text/javascript">
    var obj = {};
    var nbr = [1];

    // Available in the window object.
    isEmpty(obj);      // true
    isEmpty(nbr);      // false
    isNotEmpty(nbr);   // true
</script>

NodeJS Usage

npm install --save @jsmicro/is-empty
const obj = require('@jsmicro/is-empty');

// Available in the global object.
isEmpty([]); // true
isEmpty({a: 1}); // false
isNotEmpty('a'); // true

// Also available in the export object.
obj.isEmpty([]); // true
obj.isEmpty('a'); // false
obj.isNotEmpty([1]); // true

Changelogs

v1.0.1 - May 21, 2016

  • Added .npmignore

v1.0.0 - May 21, 2016

  • Initial release.

About

Javascript Empty value checker

Resources

Stars

Watchers

Forks

Packages

No packages published