function saveData(sample) {
    if(stream === undefined) {
        stream = fs.createWriteStream("data/data-" + formatDate + ".json", {flags: "a"});
        console.log("stream");
    }
    let record = JSON.stringify(sample);
    stream.write(record + ",\n");
    process.stdout.write("save data...\r");
}
/**
 * save incoming sample"s to json file with current date time in filename
 *
 */
save incoming sample"s to json file with current date time in filename
save incoming sample " s to json file with current date time in filename
function saveData(sample) {
    if(stream === undefined) {
        stream = fs.createWriteStream("data/data-" + formatDate + ".json", {flags: "a"});
        console.log("stream");
    }
    let record = JSON.stringify(sample);
    stream.write(record + ",\n");
    process.stdout.write("save data...\r");
}
function saveData ( sample ) { if ( stream === undefined ) { stream = fs . createWriteStream ( "data/data-" + formatDate + ".json" , { flags : "a" } ) ; console . log ( "stream" ) ; } let record = JSON . stringify ( sample ) ; stream . write ( record + ",\n" ) ; process . stdout . write ( "save data...\r" ) ; }
save incoming sample"s to json file with current date time in filename
save incoming sample " s to json file with current date time in filename