is-user

1.4.1 • Public • Published

Is-User

An utility to check if a role is assigned to an user.

travis build version MIT License XO code style

How to use

const isUser = require('is-user');
export.update = function(req, res){

    //chaching the roles for future use in this function"
    const userArr = ['user', 'admin', 'manager', 'superadmin', 'ceo'];

    isUser.cache(userArr);
    
    let isAdmin =  isUser.is('admin'); //true
    let isManager = isUser.is('manager'); //true
}

Package Sidebar

Install

npm i is-user

Weekly Downloads

0

Version

1.4.1

License

MIT

Unpacked Size

3.34 kB

Total Files

4

Last publish

Collaborators

  • manishsaraan