‚̧Nascent Plasticine Materialist
    Wondering what‚Äôs next for npm?Check out our public roadmap! ¬Ľ

    jsmicro-is-empty

    1.0.1¬†‚Äʬ†Public¬†‚Äʬ†Published

    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.

    The MIT License (MIT)

    Install

    npm i jsmicro-is-empty

    DownloadsWeekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar