{"id":13832400,"url":"https://github.com/simple-statistics/stream-statistics","last_synced_at":"2025-07-09T16:35:50.616Z","repository":{"id":3737022,"uuid":"4810965","full_name":"simple-statistics/stream-statistics","owner":"simple-statistics","description":"streaming statistical calculations for node","archived":true,"fork":false,"pushed_at":"2017-04-10T20:42:37.000Z","size":175,"stargazers_count":61,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-03T00:24:18.295Z","etag":null,"topics":["javascript","statistics"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simple-statistics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-27T16:43:40.000Z","updated_at":"2023-12-07T20:38:21.000Z","dependencies_parsed_at":"2022-07-09T12:00:38.066Z","dependency_job_id":null,"html_url":"https://github.com/simple-statistics/stream-statistics","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-statistics%2Fstream-statistics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-statistics%2Fstream-statistics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-statistics%2Fstream-statistics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-statistics%2Fstream-statistics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simple-statistics","download_url":"https://codeload.github.com/simple-statistics/stream-statistics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225575412,"owners_count":17490750,"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":["javascript","statistics"],"created_at":"2024-08-04T10:02:02.074Z","updated_at":"2024-11-20T14:31:05.882Z","avatar_url":"https://github.com/simple-statistics.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/tmcw/stream-statistics.svg?branch=v0.1.0)](https://travis-ci.org/tmcw/stream-statistics)\n\n![](https://farm9.staticflickr.com/8282/7711892138_6a4c08cd71_b.jpg)\n\n## stream-statistics\n\n### Install\n\n    npm install stream-statistics\n\n### API\n\nThis module exposes a single function that creates a stream. The stream\nreads data, which it parses with `parseFloat()`, and computes statistics\non that data. When the input stream ends, `stream-statistics` emits the\n`data` object.\n\nThe statistics object has the following members:\n\n* `min`\n* `max`\n* `sum`\n* `mean`\n* `mode`\n* `variance`\n* `standard_deviation`\n* `geometric_mean`\n* `harmonic_mean`\n\n`mode` computation expects the stream to deliver numbers in sorted lowest-first\norder, and will return `undefined` if that expectation is not met.\n\n### Use\n\n```javascript\nvar streamStatistics = require('stream-statistics'),\n    assert = require('assert');\n\nfunction rangeStream(a, b) {\n    var rs = new Readable({ objectMode: true });\n    for (var i = 10; i \u003c 1000; i++) { rs.push(i); }\n    rs.push(null);\n    return rs;\n}\n\nrangeStream(10, 1000).pipe(streamStatistics())\n    .on('data', function(d) {\n        assert.equal(d.min, 10);\n    });\n```\n\n## cli\n\nThis also provides a binary, `sstatistics`, that you can get if you\n`npm install -g` the library. Pipe numbers into it and it'll return\na basic set of stats about its input.\n\n![](https://github.com/tmcw/stream-statistics/blob/master/screenshot.png?raw=true)\n\n## [Documentation](https://github.com/tmcw/stream-statistics/wiki)\n\n## See Also\n\n* The sister project, [simple-statistics](https://github.com/tmcw/simple-statistics), that implements\n  many of the same measures in straightforward and literate fashion\n* [streaming-k-means](https://github.com/piatra/streaming-k-means) implements k-means clustering in an online fashion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-statistics%2Fstream-statistics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimple-statistics%2Fstream-statistics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-statistics%2Fstream-statistics/lists"}