Greenlet for Node worker_threads
Works with ESM and CommonJS.
import greenlet from 'greenlet-node';
const add = greenlet(async (a, b) => {
return a + b;
});
await add(1, 2);
Example 2:
import greenlet from 'greenlet-node';
const add = greenlet(async (a, b) => {
const someLib = require('some-lib');
return someLib.add(a, b);
});
await add(1, 2);
Hi it seems like that this package is not published yet, can I help and publish this as a package for my own use? I think it will be more appropriate if you would publish it or I try to make a pull request to
greenlet
and make it usable in both browser and node?