node.js - "Unique Name" in NodeJS -


i have implemented nodejs server capable of receiving streams several users. now, have problems names of audio files. solution, works is:

  var d = new date();   n = d.gettime();      var filewriter = new wav.filewriter(n + '.wav', {     channels: 1,     samplerate: 48000,     bitdepth: 16   }); 

so giving milliseconds after 1970. not prettier solution, , want give "unique name" each record. how can achieve this?

possible solution: unique-name

usage:

var uniquename = require('unique-name'); var test = uniquename.gen(); console.log(test); console.log(typeof test);//string var test2 = uniquename.gen(); console.log(test2); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -