2023-10-02 02:14:36 +00:00
|
|
|
const { parentPort, workerData } = require('worker_threads');
|
|
|
|
const { amt } = workerData;
|
2023-10-02 02:14:36 +00:00
|
|
|
var randomWords = require('../lib/randomword');
|
2023-10-02 02:14:36 +00:00
|
|
|
|
2023-10-02 02:14:36 +00:00
|
|
|
var output = [];
|
2023-10-02 02:14:36 +00:00
|
|
|
var string = [];
|
|
|
|
var text = [];
|
|
|
|
for(var i=0; i < amt; i++){
|
|
|
|
var word = randomWords({ exactly: 1 });
|
|
|
|
text.push(word);
|
|
|
|
}
|
|
|
|
var string = text.join(" ")
|
|
|
|
|
2023-10-02 02:14:36 +00:00
|
|
|
output.push(string);
|
|
|
|
parentPort.postMessage(output);
|
2023-10-02 02:14:36 +00:00
|
|
|
process.exit()
|