Comparing version 1.2.3 to 1.2.4
18
index.js
@@ -13,2 +13,13 @@ #!/usr/bin/env node | ||
function makeid() { | ||
var text = ""; | ||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | ||
for (var i = 0; i < 10; i++) | ||
text += possible.charAt(Math.floor(Math.random() * possible.length)); | ||
return text; | ||
} | ||
mkdirp(destination, function (err) { | ||
@@ -39,3 +50,3 @@ if (err) { | ||
var key = _event.value.frame.testData.metadata.find(function(r) { return r.key === '!instrument.serial'}) | ||
var dateTime = _event.value.frame.testData.metadata.find(function(r) { return r.key === '!tablet.dateTime'}) | ||
var _time = _event.value.frame.testData.metadata.find(function(r) { return r.key === '!tablet.dateTime'}).value | ||
@@ -47,6 +58,5 @@ if (key) { | ||
var pieces = path.basename(file, '.txt').split(' ') | ||
console.log(path.basename(file, '.txt')) | ||
console.log(typeof _time, JSON.stringify(_time)) | ||
var name = instrumentName + '-' + _time.toString() + '-' + pieces[0] + '-' + makeid() + '.txt' | ||
var name = instrumentName + '-' + dateTime + '-' + '-' + pieces[0] + '-' + uuid() + '.txt' | ||
var writeStream = fs.createWriteStream(destination + '/' + name) | ||
@@ -53,0 +63,0 @@ fs.createReadStream(file).pipe(writeStream) |
{ | ||
"name": "flat-spe", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
324740520
752
51