{"id":13670743,"url":"https://github.com/wallet77/v8-inspector-api","last_synced_at":"2025-04-09T05:08:10.147Z","repository":{"id":46071170,"uuid":"195447017","full_name":"wallet77/v8-inspector-api","owner":"wallet77","description":"A simple node module to access V8 inspector + some tools to export and read the data.","archived":false,"fork":false,"pushed_at":"2025-01-10T10:38:08.000Z","size":1610,"stargazers_count":73,"open_issues_count":2,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T03:17:45.832Z","etag":null,"topics":["coverage","cpu-profiler","cpu-profiling","inspector","memory","memory-dump","nodejs","v8-javascript-engine","v8js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wallet77.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-05T17:38:15.000Z","updated_at":"2025-01-21T21:13:06.000Z","dependencies_parsed_at":"2025-01-10T11:39:48.387Z","dependency_job_id":null,"html_url":"https://github.com/wallet77/v8-inspector-api","commit_stats":{"total_commits":84,"total_committers":3,"mean_commits":28.0,"dds":0.0357142857142857,"last_synced_commit":"90de3662b5b2581233e60a0e89d229cc546651f2"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallet77%2Fv8-inspector-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallet77%2Fv8-inspector-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallet77%2Fv8-inspector-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallet77%2Fv8-inspector-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wallet77","download_url":"https://codeload.github.com/wallet77/v8-inspector-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coverage","cpu-profiler","cpu-profiling","inspector","memory","memory-dump","nodejs","v8-javascript-engine","v8js"],"created_at":"2024-08-02T09:00:48.856Z","updated_at":"2025-04-09T05:08:10.130Z","avatar_url":"https://github.com/wallet77.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![GitHub release](https://img.shields.io/npm/v/inspector-api.svg)](https://github.com/wallet77/v8-inspector-api/releases/)\n[![GitHub license](https://img.shields.io/github/license/wallet77/v8-inspector-api.svg)](https://github.com/wallet77/v8-inspector-api/blob/master/LICENSE)\n\n[![CI pipeline](https://github.com/wallet77/v8-inspector-api/workflows/Node.js%20CI/badge.svg)](https://github.com/wallet77/v8-inspector-api/actions?query=workflow%3A%22Node.js+CI%22)\n[![Code coverage](https://codecov.io/gh/wallet77/v8-inspector-api/branch/master/graph/badge.svg)](https://codecov.io/gh/wallet77/v8-inspector-api)\n[![Opened issues](https://img.shields.io/github/issues-raw/wallet77/v8-inspector-api)](https://github.com/wallet77/v8-inspector-api/issues)\n[![Opened PR](https://img.shields.io/github/issues-pr-raw/wallet77/v8-inspector-api)](https://github.com/wallet77/v8-inspector-api/pulls)\n[![DeepScan grade](https://deepscan.io/api/teams/12061/projects/15020/branches/292505/badge/grade.svg)](https://deepscan.io/dashboard#view=project\u0026tid=12061\u0026pid=15020\u0026bid=292505)\n[![Node version](https://img.shields.io/node/v-lts/inspector-api.svg)](https://github.com/wallet77/v8-inspector-api)\n\n# Purpose\n\nSimple wrapper around \"inspector\" module.\nBasically it adds :\n- promises \u0026 async/await syntax\n- S3 exporter\n\n# Compatibility\n\n| Version       | Supported     | Tested         |\n|:-------------:|:-------------:|:--------------:|\n| 20.x          | yes           | yes            |\n| 18.x          | yes           | yes            |\n| 16.x          | yes           | yes            |\n\n**In order to have all features we recommend to use at least Node.js version 10 or higher.**\n\n# Installation\n\n```console\n$ npm install inspector-api --save\n```\n\n# Usage\n\n## CPU profiling\n```javascript\nconst Inspector = require('inspector-api')\nconst inspector = new Inspector()\n\nawait inspector.profiler.enable()\nawait inspector.profiler.start()\n// Invoke business logic under measurement here...\n\n// some time later...\nawait inspector.profiler.stop()\n\n```\n\n## Memory sampling\n```javascript\nconst Inspector = require('inspector-api')\nconst inspector = new Inspector()\n\nawait inspector.heap.enable()\nawait inspector.heap.startSampling()\n// Invoke business logic under measurement here...\n\n// some time later...\nawait inspector.heap.stopSampling()\n\n```\n\n## Memory snapshot\n```javascript\nconst Inspector = require('inspector-api')\nconst inspector = new Inspector()\n\nawait inspector.heap.takeSnapshot()\n\n```\n\n## Code coverage\n```javascript\nconst Inspector = require('inspector-api')\nconst inspector = new Inspector()\n\nawait inspector.profiler.enable()\nawait inspector.profiler.startPreciseCoverage({ callCount: true, detailed: true })\n\nconst data = await inspector.profiler.takePreciseCoverage()\nawait inspector.profiler.stopPreciseCoverage()\n\n```\n\n## Use S3 exporter\n```javascript\nconst Inspector = require('inspector-api')\nconst inspector = new Inspector({\n    storage: {\n        type: 's3',\n        bucket: 'testBucket',\n        dir: 'inspector'\n    }\n})\n\nawait inspector.profiler.enable()\nawait inspector.profiler.start()\n// Invoke business logic under measurement here...\n\n// some time later...\nawait inspector.profiler.stop()\n\n```\n\n**Warning: it seems that the new AWS SDK leads to unexpected error if you use the takeSnapshot method (you should use memory sampling)**\n\n### Constructor's config\n\n```javascript\nnew inspector([config])\n```\n\n#### config.storage\n\n| Option        | description                                | Default value  |\n|:-------------:|:------------------------------------------:|:--------------:|\n| `type`        | Storage type (raw, s3 or fs)               | raw            |\n| `bucket`      | S3 bucket's name                           | none           |\n| `dir`         | Directory where to store the file          | none           |\n\nIf you use fs, the generated data will be store on the disk in your default tmp directory.\nYou can display it in Node.js with the command `require('os').tmpdir()`\n\n# Test\n\n```console\n$ npm test\n```\n\nCoverage report can be found in coverage/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallet77%2Fv8-inspector-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwallet77%2Fv8-inspector-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallet77%2Fv8-inspector-api/lists"}