
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Эта Node.js библиотека позволяет выполнять функцию в новом потоке и получать доступ к результатам вычислений через Promise.
Благодаря wormise вы можете получить удобный интерфейс-обертку для работы с вычислениями в новом потоке.
wormise(executedFunction, dir, params): Promise
dir - папка в которой выполняется вызов wormise
executedFunction - функция, выполняемая в отдельном потоке.
params - параметры для executedFunction
Поддерживает ESM (wormise/esm) и CJS (wormise/cjs).
This Node.js library allows you to execute a function in a new thread and access the results of the calculation through Promise.
With wormise, you can get a convenient wrapper interface to work with computations in a new thread.
Supports ESM (wormise/esm) and CJS (wormise/cjs).
wormise(executedFunction, dir, params): Promise
dir - the folder where the wormise call is made.
executedFunction - function executed in a separate thread.
params - arguments for executedFunction
import wormise, { wormiseDafaultDirname } from 'wormise/esm';
const dir = wormiseDafaultDirname(import.meta.url);
async function getCalculationsResult() {
try {
const result = await wormise(
params => {
// Complicated calculations
return new Date(params);
},
dir,
Date.now(),
);
console.log(result);
} catch (error) {
console.error(error);
}
}
getCalculationsResult();
import wormise, { wormiseDafaultDirname } from 'wormise/esm';
const dir = wormiseDafaultDirname(import.meta.url);
import { threadId } from 'worker_threads';
console.log({ threadId });
const data = wormise(
async () => {
const logWormiseThreadId = async () => {
const { threadId } = await import('worker_threads');
console.log({ threadId });
};
await logWormiseThreadId();
},
dir,
undefined,
);
// Output:
// { threadId: 0 }
// { threadId: 1 }
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": true,
"skipLibCheck": true,
"moduleResolution": "NodeNext",
"noEmitHelpers": true,
"outDir": "dist"
}
}
Just import from wormise/cjs like this:
import wormise, { wormiseDafaultDirname } from 'wormise/cjs';
async function getCalculationsResult() {
try {
const result = await wormise(
params => {
// Complicated calculations
return new Date(params);
},
__dirname,
Date.now(),
);
console.log(result);
} catch (error) {
console.error(error);
}
}
getCalculationsResult();
FAQs
With this library, you can create a Promise that executes in a new thread.
The npm package wormise receives a total of 3 weekly downloads. As such, wormise popularity was classified as not popular.
We found that wormise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.