Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
cnysa
(unpronouncible) is a module that allows you to see information about what the async_hooks
module is doing under the covers.
Require cynsa
in your application:
node --require cynsa app.js
For each init
, before
, promiseResolve
, and destroy
event, a line will be printed.
Each of those lines start with a symbol:
+
Init*
Before-
Destroy:
Promise FulfillmentThe number that follows is the current time in seconds, mod 1000.
A string after represents the async resource type.
After that, you get a list of numbers delimited by :
. The first number is the uid
passed in to the corresponding hook, and subsequent numbers follow its triggerAsyncId
chain.
For before
lines, you'll also see the current execution ID (ex), trigger ID (tr), and an opening brace.
before
-after
pairs are visualized as indents. A closing brace indicates an after
event emission.
Let's say the following is app.js
:
const express = require('express');
const server = express()
.get('/', (req, res) => res.send("i'm rooting for you"))
.listen(8080);
setTimeout(() => server.close(), 5000);
Running the command in the "Usage" section gives you (in colors):
+ [ 0] TCPWRAP 6:1
+ [ 0] TickObject 7:6:1
+ [ 0] Timeout 8:1
+ [ 0] TIMERWRAP 9:1
* [ 0] TickObject 7|ex 7|tr 6 {
}
- [ 0] TickObject 7
* [ 5] TIMERWRAP 9|ex 0|tr 0 {
* [ 5] Timeout 8|ex 8|tr 1 {
+ [ 5] TickObject 10:8:1
}
}
* [ 5] TickObject 10|ex 10|tr 8 {
}
- [ 5] Timeout 8
- [ 5] TickObject 10
- [ 5] TIMERWRAP 9
- [ 5] TCPWRAP 6
FAQs
A tool for understanding async-hooks
The npm package cnysa receives a total of 0 weekly downloads. As such, cnysa popularity was classified as not popular.
We found that cnysa demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.