{"id":13600142,"url":"https://github.com/nodejs/node-report","last_synced_at":"2025-10-04T01:31:15.892Z","repository":{"id":53613268,"uuid":"65297067","full_name":"nodejs/node-report","owner":"nodejs","description":"Delivers a human-readable diagnostic summary, written to file.","archived":true,"fork":false,"pushed_at":"2021-06-17T19:56:46.000Z","size":231,"stargazers_count":326,"open_issues_count":6,"forks_count":45,"subscribers_count":24,"default_branch":"main","last_synced_at":"2024-10-29T17:20:59.739Z","etag":null,"topics":["node","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-report","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodejs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-09T13:25:33.000Z","updated_at":"2024-05-22T07:45:00.000Z","dependencies_parsed_at":"2022-09-19T02:10:35.529Z","dependency_job_id":null,"html_url":"https://github.com/nodejs/node-report","commit_stats":{"total_commits":118,"total_committers":13,"mean_commits":9.076923076923077,"dds":0.5169491525423728,"last_synced_commit":"90547492f5da29948b00a19b13490b2ebe2c0cd6"},"previous_names":["nodejs/nodereport"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fnode-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fnode-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fnode-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fnode-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodejs","download_url":"https://codeload.github.com/nodejs/node-report/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234889365,"owners_count":18902383,"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":["node","nodejs"],"created_at":"2024-08-01T18:00:28.967Z","updated_at":"2025-10-04T01:31:10.620Z","avatar_url":"https://github.com/nodejs.png","language":"C++","readme":"THIS PROJECT HAS BEEN ARCHIVED.  \n\nNode-report is now supported as part of Node.js itself.\n\n# node-report\n\nDelivers a human-readable diagnostic summary, written to file.\n\nThe report is intended for development, test and production\nuse, to capture and preserve information for problem determination.\nIt includes JavaScript and native stack traces, heap statistics,\nplatform information and resource usage etc. With the report enabled,\nreports can be triggered on unhandled exceptions, fatal errors, signals\nand calls to a JavaScript API.\n\nSupports Node.js versions 8, 10 and 12 on AIX, Linux, macOS, SmartOS and\nWindows. Node.js 12 and later contain similar functionality in the built-in\n[Diagnostic Report][] feature.\n\nNOTE: This repo will be archived and the npm package will be sunset\nin lieu of [Diagnostic Report][], when Node.js 10 enters End-of-Life.\n\n## Usage\n\n```bash\nnpm install node-report\nnode -r node-report app.js\n```\nA report will be triggered automatically on unhandled exceptions and fatal\nerror events (for example out of memory errors), and can also be triggered\nby sending a USR2 signal to a Node.js process (not supported on Windows).\n\nA report can also be triggered via an API call from a JavaScript\napplication.\n\n```js\nvar nodereport = require('node-report');\nnodereport.triggerReport();\n```\nThe content of a report can also be returned as a JavaScript string via an\nAPI call from a JavaScript application.\n\n```js\nvar nodereport = require('node-report');\nvar report_str = nodereport.getReport();\nconsole.log(report_str);\n```\nThe API can be used without adding the automatic exception and fatal error\nhooks and the signal handler, as follows:\n\n```js\nvar nodereport = require('node-report/api');\nnodereport.triggerReport();\n```\n\nContent of the report consists of a header section containing the event\ntype, date, time, PID and Node version, sections containing JavaScript and\nnative stack traces, a section containing V8 heap information, a section\ncontaining libuv handle information and an OS platform information section\nshowing CPU and memory usage and system limits. An example report can be\ntriggered using the Node.js REPL:\n\n```\n$ node\n\u003e nodereport = require('node-report')\n\u003e nodereport.triggerReport()\nWriting Node.js report to file: node-report.20161020.091102.8480.001.txt\nNode.js report completed\n\u003e\n```\n\nWhen a report is triggered, start and end messages are issued to stderr\nand the filename of the report is returned to the caller. The default filename\nincludes the date, time, PID and a sequence number. Alternatively, a filename\ncan be specified as a parameter on the `triggerReport()` call.\n\n```js\nnodereport.triggerReport(\"myReportName\");\n```\n\nBoth `triggerReport()` and `getReport()` can take an optional `Error` object\nas a parameter. If an `Error` object is provided, the message and stack trace\nfrom the object will be included in the report in the `JavaScript Exception\nDetails` section.\nWhen using node-report to handle errors in a callback or an exception handler\nthis allows the report to include the location of the original error as well\nas where it was handled.\nIf both a filename and `Error` object are passed to `triggerReport()` the\n`Error` object should be the second parameter.\n\n```js\ntry {\n  process.chdir('/foo/foo');\n} catch (err) {\n  nodereport.triggerReport(err);\n}\n  ...\n});\n```\n\n## Configuration\n\nAdditional configuration is available using the following APIs:\n\n```js\nvar nodereport = require('node-report/api');\nnodereport.setEvents(\"exception+fatalerror+signal+apicall\");\nnodereport.setSignal(\"SIGUSR2|SIGQUIT\");\nnodereport.setFileName(\"stdout|stderr|\u003cfilename\u003e\");\nnodereport.setDirectory(\"\u003cfull path\u003e\");\nnodereport.setVerbose(\"yes|no\");\n```\n\nConfiguration on module initialization is also available via environment variables:\n\n```bash\nexport NODEREPORT_EVENTS=exception+fatalerror+signal+apicall\nexport NODEREPORT_SIGNAL=SIGUSR2|SIGQUIT\nexport NODEREPORT_FILENAME=stdout|stderr|\u003cfilename\u003e\nexport NODEREPORT_DIRECTORY=\u003cfull path\u003e\nexport NODEREPORT_VERBOSE=yes|no\n```\n\n## Examples\n\nTo see examples of reports generated from these events you can run the\ndemonstration applications provided in the node-report github repository. These are\nNode.js applications which will prompt you to trigger the required event.\n\n1. `api.js` - report triggered by JavaScript API call.\n2. `exception.js` - report triggered by unhandled exception.\n3. `fatalerror.js` - report triggered by fatal error on JavaScript heap out of memory.\n4. `loop.js` - looping application, report triggered using kill `-USR2 \u003cpid\u003e`.\n\n## License\n\n[Licensed under the MIT License.](LICENSE.md)\n\n[Diagnostic Report]: https://nodejs.org/dist/latest-v12.x/docs/api/report.html\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejs%2Fnode-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodejs%2Fnode-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejs%2Fnode-report/lists"}