{"id":13548087,"url":"https://github.com/jaridmargolin/inspect-process","last_synced_at":"2025-04-04T10:09:24.897Z","repository":{"id":57274721,"uuid":"72242954","full_name":"jaridmargolin/inspect-process","owner":"jaridmargolin","description":"🔍 Dead simple debugging for node.js using chrome-devtools.","archived":false,"fork":false,"pushed_at":"2020-05-23T12:11:50.000Z","size":113,"stargazers_count":426,"open_issues_count":38,"forks_count":26,"subscribers_count":5,"default_branch":"dev","last_synced_at":"2024-04-15T00:15:15.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaridmargolin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-28T21:21:38.000Z","updated_at":"2024-01-04T16:08:37.000Z","dependencies_parsed_at":"2022-09-17T12:42:22.231Z","dependency_job_id":null,"html_url":"https://github.com/jaridmargolin/inspect-process","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaridmargolin%2Finspect-process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaridmargolin%2Finspect-process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaridmargolin%2Finspect-process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaridmargolin%2Finspect-process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaridmargolin","download_url":"https://codeload.github.com/jaridmargolin/inspect-process/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157283,"owners_count":20893220,"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":[],"created_at":"2024-08-01T12:01:05.511Z","updated_at":"2025-04-04T10:09:24.870Z","avatar_url":"https://github.com/jaridmargolin.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003einspect-process\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eDead simple debugging for node.js using chrome-devtools.\u003c/p\u003e\n  \u003cdiv\u003e\n  \u003ca href=\"https://travis-ci.org/jaridmargolin/inspect-process\"\u003e\u003cimg src=\"https://travis-ci.org/jaridmargolin/inspect-process.svg?branch=master\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/jaridmargolin/inspect-process?branch=master\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/jaridmargolin/inspect-process/badge.svg?branch=master\" alt=\"Coverage Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://standardjs.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg\" alt=\"Standard - JavaScript Style Guide\"\u003e\u003c/a\u003e\n  \u003c/div\u003e\n  \u003cdiv\u003e\n  \u003ca href=\"https://npmjs.org/package/inspect-process\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/inspect-process.svg\" alt=\"NPM inspect-process package\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://david-dm.org/jaridmargolin/inspect-process\"\u003e\u003cimg src=\"https://david-dm.org/jaridmargolin/inspect-process.svg\" alt=\"Dependency Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://david-dm.org/jaridmargolin/inspect-process#info=devDependencies\"\u003e\u003cimg src=\"https://david-dm.org/jaridmargolin/inspect-process/dev-status.svg\" alt=\"devDependency Status\"\u003e\u003c/a\u003e\n  \u003c/div\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://cldup.com/EKt_O0lK-F.gif\" width=\"100%\"\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n### Why?\n\nNode added support for v8-inspector in [v6.3.0](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V6.md#6.3.0) but launching the debugger for a given process is still a little clumsy. **inspect-process** solves the following problems:\n\n* Opening and refreshing devtools - A new instance is launched each time a process is launched.\n* Unable to debug executables - Looks up path to executables such as mocha, grunt, by looking in PATH prior to resolving as a file.\n* 'Unable to open devtools socket: address already in use' - Finds an open port prior to starting the inspector. Begins searching for available ports starting at the node default inspector port, `9229`.\n* Requiring `debug-brk` - Bypasses the user requirement of setting this flag by ensuring devtools is connected prior to advancing. Just set your debug break points, and `inspect-process` will be able to pick it up.\n\nBehind the scenes **inspect-process** attempts to normalize your experience by:\n\n* Hiding the noisy output broadcast by the default `--inspect` flag. You don't need to worry about attaching,detaching, and cleaning up. Just inspect.\n* Automatically forcing color output; plays nicely with any module utilzing `supports-color`.\n\n### How is this different from node-inspector?\n\n**inspect-process** is only a small wrapper around the native `--inspect` functionaltiy provided by node. The key differences between utilizing `--inspect` and `node-inspector` can be found in [this comment by pavelfeldman](https://github.com/nodejs/node/pull/6792#issuecomment-219756916)\n\n\n## Usage\n\nInstall this globally and you'll have access to the `inspect` command anywhere on your system.\n\n```\nnpm install -g inspect-process\n```\n\n**Inspecting a file**\n\n```\n$ inspect index.js\n```\n\n**Inspecting an executable**\n\n```\n$ inspect grunt\n```\n\n**Passing arguments to process**\n\nJust pass your arguments after the process.\n\n```\ninspect index.js --argument=val\n```\n\n**Passing arguments to node**\n\nArguments are passed to the process just as if you were utilizing the node CLI.\n\n```\ninspect --harmony index.js\n```\n\n### Options\n\n**--debug-exception** Pause debugger on exceptions. [boolean]\n\n**--log-level**: The level to display logs at. [string] (choices: \"silly\", \"verbose\", \"info\")\n\n\n## Tests\n\n**Install Dependencies**\n\n```\nnpm install\n```\n\n**Run**\n\n```\nnpm test\n```\n\n\n## Known Issues\n\n### Child Processes\n\nInspecting a child process is not currently possible (and most likely never will be). Unfortunately **inspect-process** can not force child processes to spawn with the necessary `--inspect` flag.\n\nThis is clear when looking at all of the provided mocha examples. The actual `mocha` executable is a wrapper that spawns `_mocha` (done in order to allow passing flags to the node process). In order to use mocha with **inspect-process**, we have to bypass that first indirection and use the `_mocha` exectuable directly: `inspect _mocha`.\n\nIf you have control of the source code responsible for spawning the child process, it is technically possible to still utilize **inspect-process** by working with [programatic api](https://github.com/jaridmargolin/inspect-process/blob/master/lib/index.js), however this is not recommended for most use cases.\n\n### Internet Connectivity (\u003e Node 7.1.0)\n\nVersions of Node prior to 7.1.0 require a specific devtools version which is downloaded from the cloud (hence \"remote\" in the URL string). Node 7.1.0 and on will be exposing a stable protocol which will work with the devtools version bundled with the Chrome ([source](https://github.com/jaridmargolin/inspect-process/issues/18#issuecomment-259748007)).\n\n## License\n\nThe MIT License (MIT) Copyright (c) 2016 Jarid Margolin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaridmargolin%2Finspect-process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaridmargolin%2Finspect-process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaridmargolin%2Finspect-process/lists"}