real-async

0.1.0 • Public • Published

real-async

import work from "real-async";

work(() => {
  console.log('This runs in another core')
});

const value = await work(() => {
  return 10n ** 10000n
  // executed in another core and returned
})

const data = "logs..."
work(() => {
  fs.readFileSync('log.txt', data) // Write in parallel
}, { data, fs }) // send data, it is going to be serialized

const encrypted = await work(async () => {
  const bcrypt = await import('bcrypt') // import libraries
  return bcrypt.hash('1234', 15)
})

Readme

Keywords

none

Package Sidebar

Install

npm i real-async

Weekly Downloads

4

Version

0.1.0

License

none

Unpacked Size

4.01 kB

Total Files

5

Last publish

Collaborators

  • nivandres_