Skip to content

xujif/async-hooks-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version node version npm download npm license

async hooks node

track async-hooks execution as linked-list.

API

// export type Node = {
//   parent?: Node
//   asyncId: number
// }

import { executionAsyncNode } from 'async-hooks-node';
const node1 = executionAsyncNode()

setTimeout(() => {
  const node2 = executionAsyncNode()
  // node2.parent == node1
}, 1);

it is easily to implement any thread-local like async-context with extending Node or using WeakMap.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published