{"id":20767002,"url":"https://github.com/binded/meterstream","last_synced_at":"2025-03-11T18:51:23.679Z","repository":{"id":57295938,"uuid":"68408606","full_name":"binded/meterstream","owner":"binded","description":"Node.js transform stream that emits an error if it has read more than maxBytes bytes.","archived":false,"fork":false,"pushed_at":"2016-09-16T22:42:15.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-04T23:17:41.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/binded.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-09-16T19:21:48.000Z","updated_at":"2016-09-16T21:44:29.000Z","dependencies_parsed_at":"2022-08-27T16:50:45.224Z","dependency_job_id":null,"html_url":"https://github.com/binded/meterstream","commit_stats":null,"previous_names":["blockai/meterstream"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fmeterstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fmeterstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fmeterstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fmeterstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binded","download_url":"https://codeload.github.com/binded/meterstream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243094590,"owners_count":20235531,"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-11-17T11:27:11.948Z","updated_at":"2025-03-11T18:51:23.654Z","avatar_url":"https://github.com/binded.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# meterstream\n\n[![Build Status](https://travis-ci.org/blockai/meterstream.svg?branch=master)](https://travis-ci.org/blockai/meterstream)\n\nTransform stream that emits a `MeterStream.OverflowError` error if it has\nread more than `maxBytes` bytes.\n\nNote: if more than `maxBytes` is read, the transform will ensure that\nexactly `maxBytes` have been flushed to the readable side before\nemitting the OverflowError.\n\n## Install\n\n```bash\nnpm install --save meterstream\n```\n\nRequires Node v6+\n\n## Usage\n\n**new MeterStream(maxBytes = Infinity)**\n\nReturns a pass through stream where `maxBytes` (defaults to `Infinity`)\nis the max number of bytes to pass through before emitting an error.\n\nSee [./test](./test) directory for usage examples.\n\n```javascript\nimport MeterStream from 'meterstream'\n\nprocess.stdin\n  .pipe(new MeterStream(5))\n  .on('error', (err) =\u003e {\n    console.error('Read more than 5 bytes from stdin')\n    console.error(err)\n    process.exit(1)\n  })\n  .pipe(process.stdout)\n\n\n// echo -n \"123456789\" | babel-node src/demo.js\n// 12345Read more than 5 bytes from stdin\n// Error: Stream exceeded specified max of 5 bytes.\n//     at OverflowError (...)\n//     at ....\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinded%2Fmeterstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinded%2Fmeterstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinded%2Fmeterstream/lists"}