
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
inspector-api
Advanced tools
A simple node module to access V8 inspector + some tools to export and read the data.
Simple wrapper around "inspector" module. Basically it adds :
Version | Supported | Tested |
---|---|---|
20.x | yes | yes |
18.x | yes | yes |
16.x | yes | yes |
In order to have all features we recommend to use at least Node.js version 10 or higher.
$ npm install inspector-api --save
const Inspector = require('inspector-api')
const inspector = new Inspector()
await inspector.profiler.enable()
await inspector.profiler.start()
// Invoke business logic under measurement here...
// some time later...
await inspector.profiler.stop()
const Inspector = require('inspector-api')
const inspector = new Inspector()
await inspector.heap.enable()
await inspector.heap.startSampling()
// Invoke business logic under measurement here...
// some time later...
await inspector.heap.stopSampling()
const Inspector = require('inspector-api')
const inspector = new Inspector()
await inspector.heap.takeSnapshot()
const Inspector = require('inspector-api')
const inspector = new Inspector()
await inspector.profiler.enable()
await inspector.profiler.startPreciseCoverage({ callCount: true, detailed: true })
const data = await inspector.profiler.takePreciseCoverage()
await inspector.profiler.stopPreciseCoverage()
const Inspector = require('inspector-api')
const inspector = new Inspector({
storage: {
type: 's3',
bucket: 'testBucket',
dir: 'inspector'
}
})
await inspector.profiler.enable()
await inspector.profiler.start()
// Invoke business logic under measurement here...
// some time later...
await inspector.profiler.stop()
Warning: it seems that the new AWS SDK leads to unexpected error if you use the takeSnapshot method (you should use memory sampling)
new inspector([config])
Option | description | Default value |
---|---|---|
type | Storage type (raw, s3 or fs) | raw |
bucket | S3 bucket's name | none |
dir | Directory where to store the file | none |
If you use fs, the generated data will be store on the disk in your default tmp directory.
You can display it in Node.js with the command require('os').tmpdir()
$ npm test
Coverage report can be found in coverage/.
FAQs
A simple node module to access V8 inspector + some tools to export and read the data.
The npm package inspector-api receives a total of 43,056 weekly downloads. As such, inspector-api popularity was classified as popular.
We found that inspector-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.