You can't call them directly from the client. I usually use socket.io, you define an event in your library file where you get the data, and then call it in the acp script.
library.js
var socketAdmin = module.parent.require('./socket.io/admin');
var Groups = module.parent.require('./groups');
var User = module.parent.require('./user');
socketAdmin.yourplugin = {
// This function is now exposed as the event 'admin.yourplugin.someevent'
someevent: function (socket, data, callback) {
// Use the data from the client to grab member objects.
Groups.getMembers(data.groupName, data.start, data.stop, function (err, uids) {
if (err) return console.log(err);
User.getUsersData(uids, function (err, members){
callback(null, {members: members});
});
});
}
};
acp.js
// Send the group name with the amount of members we want to the server.
socket.emit('admin.yourplugin.someevent', {groupName: "GroupName", start: 0, stop: 200}, function (err, data) {
// Log the response, should be an array of user objects.
console.log(data.members);
});