{"id":15996265,"url":"https://github.com/zkat/checksum-stream","last_synced_at":"2025-08-01T20:39:07.299Z","repository":{"id":57197649,"uuid":"82502936","full_name":"zkat/checksum-stream","owner":"zkat","description":"Calculates and/or checks data coming through a stream and emits the digest before stream end.","archived":false,"fork":false,"pushed_at":"2017-02-21T20:15:17.000Z","size":23,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"latest","last_synced_at":"2024-12-27T20:46:14.190Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zkat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-20T01:15:29.000Z","updated_at":"2022-01-10T11:34:03.000Z","dependencies_parsed_at":"2022-09-16T13:12:01.650Z","dependency_job_id":null,"html_url":"https://github.com/zkat/checksum-stream","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fchecksum-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fchecksum-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fchecksum-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fchecksum-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkat","download_url":"https://codeload.github.com/zkat/checksum-stream/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233556645,"owners_count":18693765,"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":[],"created_at":"2024-10-08T07:41:05.840Z","updated_at":"2025-01-13T05:13:03.763Z","avatar_url":"https://github.com/zkat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# checksum-stream [![npm version](https://img.shields.io/npm/v/checksum-stream.svg)](https://npm.im/checksum-stream) [![license](https://img.shields.io/npm/l/checksum-stream.svg)](https://npm.im/checksum-stream) [![Travis](https://img.shields.io/travis/zkat/checksum-stream.svg)](https://travis-ci.org/zkat/checksum-stream) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/checksum-stream?svg=true)](https://ci.appveyor.com/project/zkat/checksum-stream) [![Coverage Status](https://coveralls.io/repos/github/zkat/checksum-stream/badge.svg?branch=latest)](https://coveralls.io/github/zkat/checksum-stream?branch=latest)\n\n[`checksum-stream`](https://npm.im/checksum-stream) is a passthrough stream that calculates the digest and size for data piped through it. Before closing, it will emit `digest` and `size` events with the final stream size.\n\nIt can also be configured to error if `digest` or `size` do not matched a passed-in value that is expected for either or both. `size` errors will always be emitted first.\n\n## Install\n\n`$ npm install --save checksum-stream`\n\n## Example\n\n### npm repo\n```javascript\nconst checksumStream = require('checksum-stream')\nconst fs = require('fs')\nconst request = require('request')\n\nlet req = request.get('https://npm.im/checksum-stream')\nreq.on('response', function (res) {\n  res.pipe(\n    checksumStream({\n      algorithm: 'sha256',\n      digest: res.headers['etag'],\n      size: res.headers['content-length']\n    }).on('error', e =\u003e throw e)\n  ).pipe(\n    fs.createWriteStream('./checksum-stream.html')\n  )\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fchecksum-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkat%2Fchecksum-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fchecksum-stream/lists"}