deasync
deasync copied to clipboard
Turns async function into sync via JavaScript wrapper of Node event loop
![image](https://user-images.githubusercontent.com/68751794/150917702-19aca3c1-48d8-4190-8938-04276a8a67b6.png)
`worker_threads` is almost fast same as current solution but requires no node bindings or `node-gyp`, while `child_process` is extremely slower. See benchmark at https://github.com/rx-ts/synckit/blob/main/benchmarks/benchmark.esm.txt
OS: Windows 10 Node: 17.0.1 This is only a problem in Node 16 and above, it was not a problem for previous versions. Running `npm install` on a machine without...
When using tools like Bazel for building, this node_module's `build` folder has files that have non reproducible natures to them because they have SHA values that change. To resolve this,...
This adds a await function that uses loopWhile underneath. Closes #90
Added function deasync.await, that is like await in async function, but works in sync function or global scope. ```js function sleepAsync(time) { return new Promise(function(resolve, reject) { setTimeout(function() { resolve()...
Allow module to be tested with ```npm test```. Add test that is verified with an assert so that it doesn't require manually reading the output.
```ts import DeAsync from 'deasync'; import * as DeAsync from 'deasync'; ```