LDAP
var config = {
url : 'ldaps://ldap.acme.com',
bindDN : 'uid=serviceUser,ou=Services,dc=acme,dc=lan',
bindCredentials : 'secret',
tlsOptions : {
rejectUnauthorized : false
},
userBindDN : 'uid={{{username}}},ou=Users,dc=acme,dc=lan',
timeout : 10,
connectTimeout : 5
};
var ldapClient = new (greppy.get('helper.ldap.client'))({
ldap: config
});
var base = 'ou=Users,dc=acme,dc=lan';
var options = {
sizeLimit : 5,
filter : '(|(fullname=*' + query +'*)(uid=' + query + '*))',
scope : 'sub'
};
ldapClient.search(base, options, function(err, results) {
if (err) {
return console.log(err);
}
console.log(ldapClient.resultsToJSON(results));
});
I18N
Check language code with regions
console.log(
greppy.helper.get('i18n').checkLanguageCode('en_GB')
);
// => true
console.log(
greppy.helper.get('i18n').checkLanguageCode('en_B')
);
// => false
Get list of all language codes with regions
console.log(
greppy.helper.get('i18n').listLanguagesCodes()
);
// [ 'aa_DJ',
// 'aa_ER',
// 'aa_ET',
// 'af_ZA',
// 'am_ET',
// 'an_ES',
// 'ar_AE',
// 'ar_BH',
// 'ar_DZ',
// 'ar_EG',
// 'ar_IN',
// 'ar_IQ',
// 'ar_JO'
// ...
// ]
Git
Path
Process
Project
Cache