jwt-express.js
function(key, operator, value) {
        if (!key) {
            throw new ReferenceError('key must be defined');
        }
        if (operator && ['==','===','!=','!==','<','<=','>','>='].indexOf(operator) === -1) {
            throw new JWTExpressError('Invalid operator: ' + operator);
        }
        
        return function(req, res, next) {
            var jwt = req[this.options.reqProperty] || {payload: {}},
            data = jwt.payload[key],
            ok;
            
            if (!operator) {
                ok = !!data;
            } else if (operator == '==') {
                ok = data == value;
            } else if (operator == '===') {
                ok = data === value;
            } else if (operator == '!=') {
                ok = data != value;
            } else if (operator == '!==') {
                ok = data !== value;
            } else if (operator == '<') {
                ok = data < value;
            } else if (operator == '<=') {
                ok = data <= value;
            } else if (operator == '>') {
                ok = data > value;
            } else if (operator == '>=') {
                ok = data >= value;
            }
            
            if (!ok) {
                var err = new JWTExpressError('JWT is insufficient');
                err.key = key;
                err.data = data;
                err.operator = operator;
                err.value = value;
                
                next(err);
            } else {
                next();
            }
        }.bind(this);
    }
function(key, operator, value) {
        if (!key) {
            throw new ReferenceError('key must be defined');
        }
        if (operator && ['==','===','!=','!==','<','<=','>','>='].indexOf(operator) === -1) {
            throw new JWTExpressError('Invalid operator: ' + operator);
        }
        
        return function(req, res, next) {
            var jwt = req[this.options.reqProperty] || {payload: {}},
            data = jwt.payload[key],
            ok;
            
            if (!operator) {
                ok = !!data;
            } else if (operator == '==') {
                ok = data == value;
            } else if (operator == '===') {
                ok = data === value;
            } else if (operator == '!=') {
                ok = data != value;
            } else if (operator == '!==') {
                ok = data !== value;
            } else if (operator == '<') {
                ok = data < value;
            } else if (operator == '<=') {
                ok = data <= value;
            } else if (operator == '>') {
                ok = data > value;
            } else if (operator == '>=') {
                ok = data >= value;
            }
            
            if (!ok) {
                var err = new JWTExpressError('JWT is insufficient');
                err.key = key;
                err.data = data;
                err.operator = operator;
                err.value = value;
                
                next(err);
            } else {
                next();
            }
        }.bind(this);
    }
require - requires that data in the JWT's payload meets certain requirements
If only the key is passed, it simply checks that payload[key] == true
@param string key The key used to load the data from the payload
@param string operator (Optional) The operator to compare the information
@param mixed value (Optional) The value to compare the data to
@return function middleware