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
Post a Comment