{"id":20213460,"url":"https://github.com/lostsource/devtools-client","last_synced_at":"2025-07-19T04:35:54.751Z","repository":{"id":151067326,"uuid":"205252433","full_name":"lostsource/devtools-client","owner":"lostsource","description":"Provides NodeJS API for instrumentation of the V8 Debugger (experimental)","archived":false,"fork":false,"pushed_at":"2019-09-08T19:35:47.000Z","size":30,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T14:06:05.832Z","etag":null,"topics":["devtools-client","devtools-protocol","inspector","node-js","v8-profiler"],"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/lostsource.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-08-29T21:21:34.000Z","updated_at":"2024-09-08T02:17:04.000Z","dependencies_parsed_at":"2023-06-29T18:01:00.034Z","dependency_job_id":null,"html_url":"https://github.com/lostsource/devtools-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lostsource/devtools-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostsource%2Fdevtools-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostsource%2Fdevtools-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostsource%2Fdevtools-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostsource%2Fdevtools-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostsource","download_url":"https://codeload.github.com/lostsource/devtools-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostsource%2Fdevtools-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265889139,"owners_count":23844539,"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":["devtools-client","devtools-protocol","inspector","node-js","v8-profiler"],"created_at":"2024-11-14T06:09:15.175Z","updated_at":"2025-07-19T04:35:54.742Z","avatar_url":"https://github.com/lostsource.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeJS DevTools Client\n\nThis module simplifies access to the [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) which can be used to control NodeJS, Chrome or Chromium.\n\nIf you're simply looking to control Chrome or Chromium I suggest using [Puppeteer](https://github.com/GoogleChrome/puppeteer) as it provides a simpler, higher level API.\n\n### Installation\n```\nnpm install devtools-client\n```\n### Usage\nThe module can launch a user specified NodeJS script or connect to an existent DevTools session.\n\n#### Launch Node Script and attach to the Debugger\n```\nconst DevToolsClient = require('devtools-client');\nconst Controller = new DevToolsClient();\n\nController.launch('/path/to/some.js').then(({Debugger, Profiler, Runtime}) =\u003e {\n  // resolves with an object containing all available DevTools domains\n});\n```\n#### Connect to an existent Debugger session\n1. Launch your Node script with the `--inspect`  argument\n```\n$ node --inspect some.js\nDebugger listening on ws://127.0.0.1:9229/08f8c820-28e7-43b1-b6f6-c39f170e489d\nFor help, see: https://nodejs.org/en/docs/inspector\n```\n2. Set the `nodeWSEndpoint` property to the WebSocket URL \n```\nconst DevToolsClient = require('devtools-client');\nconst Controller = new DevToolsClient();\n\nController.connect({\n  nodeWSEndpoint: 'ws://127.0.0.1:9229/08f8c820-28e7-43b1-b6f6-c39f170e489d'\t\n}).then(({Debugger, Runtime, Profiler}) =\u003e {\n  // resolves with an object containing all available DevTools domains\n});\n```\n### Quick Example\nRetrieve all script sources loaded\nThis example [enables](https://chromedevtools.github.io/devtools-protocol/v8/Debugger#method-enable) the Debugger domain and listens to [`scriptParsed`](https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-scriptParsed) events\n```\nconst DevToolsClient = require('devtools-client');\nconst Controller = new DevToolsClient();\n\nController.launch('/path/to/some.js').then(async ({Debugger}) =\u003e {\n  Debugger.on('scriptParsed', ({scriptId, url}) =\u003e {\n    console.log(url);  \n  });\n  Debugger.enable();\n});\n```\n\n### Methods\nDue to the asynchronous nature of the DevTools protocol, all methods return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n### Events\nProtocol events are emitted using the standard NodeJS [Event Emitter](https://nodejs.org/api/events.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostsource%2Fdevtools-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostsource%2Fdevtools-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostsource%2Fdevtools-client/lists"}