Socket
Socket
Sign inDemoInstall

vott2yolo

Package Overview
Dependencies
11
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

20

lib/cli.js

@@ -16,9 +16,15 @@ #!/usr/bin/env node

: labelObject;
await Promise.all(files.map(async (filePath) => {
const vott = JSON.parse(await fsp.readFile(filePath, 'utf8'));
const yolo = vott2yolo(vott, labels);
const destName = `${path.basename(vott.asset.name, path.extname(vott.asset.name))}.txt`;
const destPath = path.join(path.dirname(filePath), destName);
return fsp.writeFile(destPath, yolo.join(EOL), 'utf8');
}));
let processedFileCount = 0;
const totalFileCount = files.length;
while (processedFileCount < totalFileCount) {
const chunk = files.slice(processedFileCount, processedFileCount + 500);
await Promise.all(chunk.map(async (filePath) => {
const vott = JSON.parse(await fsp.readFile(filePath, 'utf8'));
const yolo = vott2yolo(vott, labels);
const destName = `${path.basename(vott.asset.name, path.extname(vott.asset.name))}.txt`;
const destPath = path.join(path.dirname(filePath), destName);
return fsp.writeFile(destPath, yolo.join(EOL), 'utf8');
}));
processedFileCount += chunk.length;
}
} catch (error) {

@@ -25,0 +31,0 @@ console.error(error);

@@ -12,3 +12,3 @@ {

},
"version": "1.0.2",
"version": "1.0.3",
"main": "lib/index.js",

@@ -15,0 +15,0 @@ "author": "Jean-Baptiste Martin",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc