1.0.1 • Published 8 years ago

absent v1.0.1

Weekly downloads
9
License
MIT
Repository
github
Last release
8 years ago

Absent

Build Status Coverage Status

Absent checks existence or blankness of a variable.

What is the goal of this project?

This project allows you to make both undefined checking and null checking on one method call. This makes your code more clean.

Installation

$ npm install --save absent

Usage

var helper = require('absent');


// null checking of null variable
var instance = null;
if( helper.isNull(instance) ) { ... }

var undefinedInstance;
if( helper.isNull(undefinedInstance) ) { ... }

var str = "";
if( helper.isBlank(str) ) { ... }

if( helper.isSet(str) ) { ... }

var isExist = false;

if( helper.not(isExist) ) { ... }

Test

This module is well tested. You can run:

  • npm test to run the tests under Node.js.

Test results

License

MIT