{"id":20462287,"url":"https://github.com/drish/node-accountant","last_synced_at":"2025-07-26T18:04:24.071Z","repository":{"id":65459870,"uuid":"78902522","full_name":"drish/node-accountant","owner":"drish","description":"A dead simple to use metrics tracker for node.js http services, it optionally sends data to statsD.","archived":false,"fork":false,"pushed_at":"2017-02-23T20:29:56.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-21T14:19:28.739Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-14T01:46:26.000Z","updated_at":"2017-01-23T23:21:25.000Z","dependencies_parsed_at":"2023-01-24T14:25:10.881Z","dependency_job_id":null,"html_url":"https://github.com/drish/node-accountant","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drish/node-accountant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drish%2Fnode-accountant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drish%2Fnode-accountant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drish%2Fnode-accountant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drish%2Fnode-accountant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drish","download_url":"https://codeload.github.com/drish/node-accountant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drish%2Fnode-accountant/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266490629,"owners_count":23937495,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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-11-15T12:34:16.934Z","updated_at":"2025-07-26T18:04:23.951Z","avatar_url":"https://github.com/drish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-accountant\n\n[![Build Status](https://travis-ci.org/drish/node-accountant.svg?branch=master)](https://travis-ci.org/drish/node-accountant)\n\nA dead simple to use metrics tracker for node.js http services, it optionally sends data to statsD, or simply prints on stdout.\n\n```\nnpm install node-accountant\n```\n\nThe goal of this project is to be a simple to use reponse time metrics tracker for http services.\nInstead of polluting your application code with metric code, you can use this lib as a\nhigh level middleware if it fits your needs.\n\n## Examples\n\n\n### stdout\n\n``` js\nconst ac = require('node-accountant');\n\napp.use(ac({ delimiter: '.' })); // GET.foo.bar - 4.153 ms\n\napp.get('/foo/bar', handler);\n```\n\n### statsd\n\n``` js\nconst ac = require('node-accountant');\n\nconst statsdInfo = {\n  host: 'localhost',\n  port: '9988'\n}\n\n// will send statsd info in the following format GET.foo.bar\n// statsd.timing('GET.foo.bar', responseTime)\napp.use(ac({ statsd: statsdInfo }));\n\napp.get('/foo/bar', handler);\napp.post('/fii/bor', handler);\n```\n\n### simple middleware callback\n\n``` js\nconst ac = require('node-accountant');\n\n// will send statsd info in the following format GET.endpoint.action\napp.use(ac((req, res, metric) =\u003e {\n  console.log(metric.responseTime)\n  console.log(metric.stat)   // data.stat GET.foo.bar\n}));\n\napp.get('/foo/bar', handler);\napp.post('/fii/bor', handler);\n```\n\n## License\n\n[MIT](https://github.com/drish/accountant/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrish%2Fnode-accountant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrish%2Fnode-accountant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrish%2Fnode-accountant/lists"}