{"_id":"@appsightnet/nodejs-aspnet-healthz","_rev":"6-e3402741017113fdbd6f16f33f1c2019","name":"@appsightnet/nodejs-aspnet-healthz","dist-tags":{"latest":"0.1.0-alpha.6"},"versions":{"0.1.0-alpha.1":{"name":"@appsightnet/nodejs-aspnet-healthz","version":"0.1.0-alpha.1","description":"This package aims to provide report output similar to the AspNetCore.Diagnostics.HealthChecks package in NuGet.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc --build tsconfig.build.json","prepare":"npm run build","test":"jest --silent=false --testTimeout=20000","docs":"typedoc"},"author":{"name":"yopiidev"},"license":"Apache-2.0","devDependencies":{"@types/jest":"^29.5.1","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.0.0","jest":"^29.5.0","prettier":"^2.8.8","ts-jest":"^29.1.0","typedoc":"^0.24.7"},"gitHead":"dd8e39af337e7c0035e18669455282ef700949d9","_id":"@appsightnet/nodejs-aspnet-healthz@0.1.0-alpha.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-QjUHqYqVvqfwpdFw3nkh1mjnr4V0WtnUk6e9CrymcvGfq+FFASQ+dxL89h9YLLw9+wnGfW746HYvkUgzj+f1Gg==","shasum":"b726cb7c88097ba4a88e337ee7a4417fb25c063a","tarball":"https://registry.npmjs.org/@appsightnet/nodejs-aspnet-healthz/-/nodejs-aspnet-healthz-0.1.0-alpha.1.tgz","fileCount":29,"unpackedSize":31891,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGb6w4MU0lQ3qOF0Gc1YKvE1dCD5o2bLPFPKNuop9tI0AiEA1zRH7V6MMSu/Sjnfbf3guNVSRPMPcrZ0Sjd04ndjgCg="}]},"_npmUser":{"name":"appsightnet","email":"appsightnet@gmail.com"},"directories":{},"maintainers":[{"name":"appsightnet","email":"appsightnet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodejs-aspnet-healthz_0.1.0-alpha.1_1684503604458_0.42649950742386555"},"_hasShrinkwrap":false},"0.1.0-alpha.2":{"name":"@appsightnet/nodejs-aspnet-healthz","version":"0.1.0-alpha.2","description":"This package aims to provide report output similar to the AspNetCore.Diagnostics.HealthChecks package in NuGet.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc --build tsconfig.build.json","prepare":"npm run build","test":"jest --silent=false --testTimeout=20000","docs":"typedoc"},"author":{"name":"yopiidev"},"license":"Apache-2.0","devDependencies":{"@types/jest":"^29.5.1","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.0.0","jest":"^29.5.0","prettier":"^2.8.8","ts-jest":"^29.1.0","typedoc":"^0.24.7"},"gitHead":"1b392ba81ccdbc92e600169f45ce4d204d2b3786","_id":"@appsightnet/nodejs-aspnet-healthz@0.1.0-alpha.2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-Xd/b0vNTb3NkwhMJa25f8EeVpWdJsFPL8dPOo7eDUrKFv63NpPV+Bwywm+C0NdeID3h0lymtW7at6r0tr6lbAw==","shasum":"6b6dff0ad4b261fb1133b45d0609d6df597fec25","tarball":"https://registry.npmjs.org/@appsightnet/nodejs-aspnet-healthz/-/nodejs-aspnet-healthz-0.1.0-alpha.2.tgz","fileCount":29,"unpackedSize":31891,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGfe9W4E5VaFDOZclchJjmpPyMhnQMRG3nSIJvhdp0DJAiEAm0+NKjRlEnyNB+360WFr3otdxxRVwSrh/gi8ARSgx2U="}]},"_npmUser":{"name":"appsightnet","email":"appsightnet@gmail.com"},"directories":{},"maintainers":[{"name":"appsightnet","email":"appsightnet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodejs-aspnet-healthz_0.1.0-alpha.2_1684504205121_0.2202490928575105"},"_hasShrinkwrap":false},"0.1.0-alpha.3":{"name":"@appsightnet/nodejs-aspnet-healthz","version":"0.1.0-alpha.3","description":"This package aims to provide report output similar to the AspNetCore.Diagnostics.HealthChecks package in NuGet.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc --build tsconfig.build.json","prepare":"npm run build","test":"jest --silent=false --testTimeout=20000","docs":"typedoc"},"author":{"name":"yopiidev"},"license":"Apache-2.0","devDependencies":{"@types/jest":"^29.5.1","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.0.0","jest":"^29.5.0","prettier":"^2.8.8","ts-jest":"^29.1.0","typedoc":"^0.24.7"},"gitHead":"0f56d78dd354dbefd370dc3fb2a854a87e63b809","_id":"@appsightnet/nodejs-aspnet-healthz@0.1.0-alpha.3","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-G26R7pL2zw9RD0lwk/i1X8nR4EAlSMDUS4u39e97zZWCZS6nR7YOh2vQ+xYoCMb/X3IMXZ2PLeblrZxdlVO6WA==","shasum":"1daf26cec322652b7b68829438991f213e4ac440","tarball":"https://registry.npmjs.org/@appsightnet/nodejs-aspnet-healthz/-/nodejs-aspnet-healthz-0.1.0-alpha.3.tgz","fileCount":78,"unpackedSize":50968,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhbV/IBmoLN3xWlYvIywr2Pix9bl2RuwRfEfNJtaKeHgIgIFqKhzPefQp4IPJIKsDPZjciYDlAEE6wVtK0Gd1UL9M="}]},"_npmUser":{"name":"appsightnet","email":"appsightnet@gmail.com"},"directories":{},"maintainers":[{"name":"appsightnet","email":"appsightnet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodejs-aspnet-healthz_0.1.0-alpha.3_1684504534373_0.41543601187631185"},"_hasShrinkwrap":false},"0.1.0-alpha.5":{"name":"@appsightnet/nodejs-aspnet-healthz","version":"0.1.0-alpha.5","description":"This package aims to provide report output similar to the AspNetCore.Diagnostics.HealthChecks package in NuGet.","repository":{"type":"git","url":"git+https://github.com/appsightnet/nodejs-aspnet-healthz.git"},"homepage":"https://github.com/appsightnet/nodejs-aspnet-healthz#readme","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc --build tsconfig.build.json","prepare":"npm run build","test":"jest --silent=false --testTimeout=20000","docs":"typedoc"},"author":{"name":"yopiidev"},"license":"Apache-2.0","devDependencies":{"@types/jest":"^29.5.1","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.0.0","jest":"^29.5.0","prettier":"^2.8.8","ts-jest":"^29.1.0","typedoc":"^0.24.7"},"gitHead":"fadea168928192f0dc3e09e4f1e9ef5674edf84e","bugs":{"url":"https://github.com/appsightnet/nodejs-aspnet-healthz/issues"},"_id":"@appsightnet/nodejs-aspnet-healthz@0.1.0-alpha.5","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-S+bo0OvQXu6LSbEw0k5xDPnP4FkG0db3C50iM0NUbgVcaXr870oKFYjHR8JvyX6qpX2zVsQo1UfGv8CXtLEmPA==","shasum":"0b17ac087cd1f9a37fc4cf338407c96bd3b00914","tarball":"https://registry.npmjs.org/@appsightnet/nodejs-aspnet-healthz/-/nodejs-aspnet-healthz-0.1.0-alpha.5.tgz","fileCount":78,"unpackedSize":51223,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXbr1dKCgE11/J6GrZoEAhSr8+bV2QslbrvcRlXFM7jAiEAiUi9DZwZFzQek078geT9HW/khwAMJFb3waiBIjkj1Ko="}]},"_npmUser":{"name":"appsightnet","email":"appsightnet@gmail.com"},"directories":{},"maintainers":[{"name":"appsightnet","email":"appsightnet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodejs-aspnet-healthz_0.1.0-alpha.5_1684506750636_0.5450284183332823"},"_hasShrinkwrap":false},"0.1.0-alpha.6":{"name":"@appsightnet/nodejs-aspnet-healthz","version":"0.1.0-alpha.6","description":"This package aims to provide report output similar to the AspNetCore.Diagnostics.HealthChecks package in NuGet.","repository":{"type":"git","url":"git+https://github.com/appsightnet/nodejs-aspnet-healthz.git"},"homepage":"https://github.com/appsightnet/nodejs-aspnet-healthz#readme","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc --build tsconfig.build.json","prepare":"npm run build","test":"jest --silent=false --testTimeout=20000","docs":"typedoc"},"author":{"name":"yopiidev"},"license":"Apache-2.0","devDependencies":{"@types/jest":"^29.5.1","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.0.0","jest":"^29.5.0","prettier":"^2.8.8","ts-jest":"^29.1.0","typedoc":"^0.24.7"},"gitHead":"6446f7d80dfe830ba4d753072a1633fb9d15cab3","bugs":{"url":"https://github.com/appsightnet/nodejs-aspnet-healthz/issues"},"_id":"@appsightnet/nodejs-aspnet-healthz@0.1.0-alpha.6","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-pB7tkCCaXlRPn6JAHQ3X1nt245U1cVolB9CzqRejilAmj3zYRRuuhgj+rrDv67gdQOI/2HqHNapHfk8HX0GD1g==","shasum":"d37664aa70b49a271b47f5b0c0fc94f32175560c","tarball":"https://registry.npmjs.org/@appsightnet/nodejs-aspnet-healthz/-/nodejs-aspnet-healthz-0.1.0-alpha.6.tgz","fileCount":78,"unpackedSize":50873,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGul4q0xH6/xnowL01jPRbPTKEDiSFTznw1f88qGW3WVAiAkHU0c30UwTdKHi1+JWplItvhza/+wv+HKVbQaHikE3g=="}]},"_npmUser":{"name":"appsightnet","email":"appsightnet@gmail.com"},"directories":{},"maintainers":[{"name":"appsightnet","email":"appsightnet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodejs-aspnet-healthz_0.1.0-alpha.6_1684552130701_0.17684165356270443"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-19T13:40:04.398Z","0.1.0-alpha.1":"2023-05-19T13:40:04.685Z","modified":"2023-07-28T00:55:51.504Z","0.1.0-alpha.2":"2023-05-19T13:50:05.313Z","0.1.0-alpha.3":"2023-05-19T13:55:34.599Z","0.1.0-alpha.5":"2023-05-19T14:32:30.833Z","0.1.0-alpha.6":"2023-05-20T03:08:50.878Z"},"maintainers":[{"email":"yopiidev@gmail.com","name":"yopiidev"},{"email":"appsightnet@gmail.com","name":"appsightnet-principal"}],"description":"This package aims to provide report output similar to the AspNetCore.Diagnostics.HealthChecks package in NuGet.","author":{"name":"yopiidev"},"license":"Apache-2.0","readme":"## Overview\n\nThis package aims to provide report output similar to the [AspNetCore.Diagnostics.HealthChecks](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks) package in NuGet.\n\n> **Note**\n> This package is currently minimally configured to support HealthReport and UIHealthReport output of AspNetCore.Diagnostics.HealthChecks 6.\\*. Therefore, for other use cases such as integrating it into routing, you will need to implement it individually for each framework.\n\n## Motivation\n\nWhen operating containerized applications, configuring health checks becomes essential. Health checks are supported in various operational environments, and while the HTTP status code rules are generally consistent, the payload schema can vary depending on the environment.\n\nIn my own experience, I frequently develop APIs using ASP.NET, and in such cases, I typically combine AspNetCore.Diagnostics.HealthChecks with HealthChecksUI for configuring and monitoring health checks.\n\nAs I have been working more with Node.js recently, I decided to develop this package to enable handling the output of AspNetCore.Diagnostics.HealthChecks in Node.js.\n\n```mermaid\ngraph LR\n    node1[\"Node.js Project\\n(Wants to export UIHealthReport!)\"]\n    node2[\"ASP.NET Project\\n(Exports UIHealthReport)\"]\n    node3[\"HealthChecks UI ASP.NET Project\\n(Collects UIHealthReport)\"]\n\n    node3-->node1\n    node3-->node2\n```\n\n## Installation\n\n```sh\nnpm install @appsightnet/nodejs-aspnet-healthz\n```\n\n## Usage\n\n```ts\n// Create HealthCheckService instance\nconst options: HealthCheckServiceOptions = {\n  registrations: [\n    {\n      name: 'healthy-0',\n      instance: new StubHealthCheck('Healthy'),\n      tags: ['liveness'],\n    },\n  ],\n}\nconst healthCheckService = new DefaultHealthCheckService(options)\n\n// Perform checks\nconst healthReport = await healthCheckService.checkHealthAsync()\n\n// Export UIHealthReport json\nconst uiHealthReport = UIHealthReportUtils.fromHealthReport(healthReport)\nconsole.log(JSON.stringify(uiHealthReport))\n```\n\n```json\n{\n  \"status\": \"Healthy\",\n  \"totalDuration\": \"00:00:00.000\",\n  \"entries\": {\n    \"healthy-0\": {\n      \"status\": \"Healthy\",\n      \"description\": \"healthy-0 is Healthy!\",\n      \"duration\": \"00:00:00.000\",\n      \"tags\": [\"liveness\"]\n    }\n  }\n}\n```\n\n## API Reference\n\n- [Docs](https://appsightnet.github.io/nodejs-aspnet-healthz/)\n\n## Options\n\n### Perform only readiness checks\n\n```ts\nconst healthReport = await healthCheckService.checkHealthAsync((predicate) =>\n  predicate.tags.includes('readiness')\n)\n```\n\n### Set timeout per registration\n\n```ts\nconst options: HealthCheckServiceOptions = {\n  registrations: [\n    {\n      name: 'healthy-0',\n      instance: new StubHealthCheck('Healthy'),\n      tags: ['liveness'],\n      timeoutMilliseconds: 1000,\n    },\n    {\n      name: 'healthy-1',\n      instance: new StubHealthCheck('Healthy'),\n      tags: ['liveness'],\n      timeoutMilliseconds: 2000,\n    },\n  ],\n}\nconst healthCheckService = new DefaultHealthCheckService(options)\n```\n\n### Set overall timeout for checks\n\n```ts\nconst healthReport = await healthCheckService.checkHealthAsync(\n  (_) => true,\n  30000 // 30 seconds\n)\n```\n\n## Change Log\n\nTBD\n\n## Acknowledgements\n\n- Special thanks to all contributors to [AspNetCore.Diagnostics.HealthChecks](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks), which served as a valuable reference for this project.\n","readmeFilename":"README.md","homepage":"https://github.com/appsightnet/nodejs-aspnet-healthz#readme","repository":{"type":"git","url":"git+https://github.com/appsightnet/nodejs-aspnet-healthz.git"},"bugs":{"url":"https://github.com/appsightnet/nodejs-aspnet-healthz/issues"}}