{"id":16580123,"url":"https://github.com/enesser/debugging-node","last_synced_at":"2026-04-19T15:34:25.031Z","repository":{"id":21056309,"uuid":"24355482","full_name":"enesser/debugging-node","owner":"enesser","description":"JavaScript and Bash techniques to assist in debugging Node.","archived":false,"fork":false,"pushed_at":"2014-09-27T22:46:02.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T23:45:04.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/enesser.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":"2014-09-23T03:32:00.000Z","updated_at":"2016-02-18T06:55:05.000Z","dependencies_parsed_at":"2022-09-13T22:51:13.713Z","dependency_job_id":null,"html_url":"https://github.com/enesser/debugging-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/enesser/debugging-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enesser%2Fdebugging-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enesser%2Fdebugging-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enesser%2Fdebugging-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enesser%2Fdebugging-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enesser","download_url":"https://codeload.github.com/enesser/debugging-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enesser%2Fdebugging-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32012260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-11T22:23:47.438Z","updated_at":"2026-04-19T15:34:25.012Z","avatar_url":"https://github.com/enesser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Debugging Node\n## JavaScript and Bash techniques to assist in debugging Node.\n\nI created this project for a presentation I gave to developers on Node. Here you'll find how to access the console timer, write console warn and error statements, traverse an object in the console, force a breakpoint, and show a stack trace in Node.\n\nYou'll also see some Bash tactics in the comments for redirecting STDOUT and STDERR. While these aren't specific to the Node environment, you can use them to help you debug, reroute output to log files, or other useful things.\n\n## Bash examples\n\n````\n# redirecting stdout, stderr to a file and also the screen using tee\n$ node debuggingNode 2\u003e\u00261 | tee tee.txt\nconsole.log statement\nconsole.warn statement\n{ id: 1,\n  active: true,\n  name: 'Sample Record',\n  date: Fri Sep 26 2014 21:21:15 GMT-0500 (Central Daylight Time) }\nconsole error statement\nstart: 3ms\nTrace\n    at Object.\u003canonymous\u003e (~/projects/debuggingNode/debuggingNode.js:33:9)\n    at Module._compile (module.js:456:26)\n    at Object.Module._extensions..js (module.js:474:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\n    at Function.Module.runMain (module.js:497:10)\n    at startup (node.js:119:16)\n    at node.js:902:3\n````\n````\n# swap stdout and stderr so that stderr is shown on the screen\n$ node debuggingNode 3\u003e\u00261 1\u003e stdout.txt 2\u003e\u00263- | tee -a stderr.txt\nconsole.warn statement\nconsole error statement\nTrace\n    at Object.\u003canonymous\u003e (~/projects/debuggingNode/debuggingNode.js:33:9)\n    at Module._compile (module.js:456:26)\n    at Object.Module._extensions..js (module.js:474:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\n    at Function.Module.runMain (module.js:497:10)\n    at startup (node.js:119:16)\n    at node.js:902:3\n\n# showing the contents of 'stdout.txt' from the example above\n$ cat stdout.txt\nconsole.log statement\n{ id: 1,\n  active: true,\n  name: 'Sample Record',\n  date: Fri Sep 26 2014 21:22:47 GMT-0500 (Central Daylight Time) }\nstart: 4ms\n\n# showing the contents of 'stderr.txt' from the example above\n$ cat stdout.txt\nconsole.warn statement\nconsole error statement\nTrace\n    at Object.\u003canonymous\u003e (~/projects/debuggingNode/debuggingNode.js:33:9)\n    at Module._compile (module.js:456:26)\n    at Object.Module._extensions..js (module.js:474:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\n    at Function.Module.runMain (module.js:497:10)\n    at startup (node.js:119:16)\n    at node.js:902:3\n````\n## Recommended Debuggers\nI highly recommend\n[node-inspector](https://github.com/node-inspector/node-inspector \"node-inspector\") for the best GUI-based debugging experience. It uses Blink Developer Tools.\n\nIf you're more hardcore, you can also use the built-in [node debugger](http://nodejs.org/api/debugger.html \"node debugger\").\n\n## Contributions\nHave any corrections or suggestions? Please feel free to contribute or contact me!\n\nenesser@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenesser%2Fdebugging-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenesser%2Fdebugging-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenesser%2Fdebugging-node/lists"}