node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey ยป



Local Windows Group Membership tests via 'net localgroup'


var winGroups = require('win-groups');

var username = process.env.username;
var testGroup = 'Users';

winGroups.isInGroup({user:username, group:testGroup}, function(err,isInGroup){
    return console.log(err);

  console.log('Is in group:', isInGroup);

Note: This would test whether the currently logged on user is part of the Users group. Windows 8: This does not seem to work on Win8 anymore though since the users are not in automatically part of the Users group anymore..