I need to create some random characters of 4-5 length in a nodejs app. Here is one module i found.
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
exports.generate = function(length) {
 length = length ? length : 32;
 var string = '';
 for (var i = 0; i < length; i++) {
  var randomNumber = Math.floor(Math.random() * chars.length);
  string += chars.substring(randomNumber, randomNumber + 1);
 }
 return string;
}
but it seems to be not async. Do i need to worry about it not being async? Is there other way around?
				
				I don't think you have to worry about it not being async (I assume you're worried about your code being blocking?).
A simple benchmark of your code using the default length (32) and 1.000.000 calls runs in about 1.2 seconds on my MBP, so that's pretty fast.
If you want to speed up your code even more, you can try this:
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
...
string += chars[randomNumber];
That makes my test run about twice as fast.