{"id":26324586,"url":"https://github.com/medz/block","last_synced_at":"2026-02-24T13:05:28.749Z","repository":{"id":280306977,"uuid":"941572816","full_name":"medz/block","owner":"medz","description":"A flexible and efficient binary data block handling library for Dart.","archived":false,"fork":false,"pushed_at":"2025-04-15T16:47:07.000Z","size":210,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-03T23:49:49.819Z","etag":null,"topics":["binary","blob","block","data","streams"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/block","language":"Dart","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/medz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-02T16:02:54.000Z","updated_at":"2025-03-15T23:44:31.000Z","dependencies_parsed_at":"2025-03-02T16:40:56.730Z","dependency_job_id":"2ea92989-4364-43e9-8788-d8b1a2ac53b4","html_url":"https://github.com/medz/block","commit_stats":null,"previous_names":["medz/block"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medz%2Fblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medz%2Fblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medz%2Fblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medz%2Fblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medz","download_url":"https://codeload.github.com/medz/block/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252448789,"owners_count":21749548,"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":["binary","blob","block","data","streams"],"created_at":"2025-03-15T18:02:25.816Z","updated_at":"2026-02-24T13:05:28.743Z","avatar_url":"https://github.com/medz.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# block\n\n[![Pub Version](https://img.shields.io/pub/v/block.svg)](https://pub.dev/packages/block)\n[![Tests Status](https://github.com/medz/block/actions/workflows/test.yml/badge.svg)](https://github.com/medz/block/actions/workflows/test.yml)\n\n`block` provides a Blob-style immutable binary data API for Dart.\n\n## Design\n\n- One minimal, Blob-compatible API surface.\n- `web`: wraps native browser `Blob` via [`package:web`](https://pub.dev/packages/web).\n- `io`: keeps small byte-only blocks in memory and lazily materializes larger/composed blocks to temp files (finalizer cleanup).\n- `Block` parts are resolved lazily for `io` composed blocks: bytes are fetched/materialized on first read (`arrayBuffer`/`text`).\n- `slice()` strategy on `io`:\n  - `\u003c= 64KB`: copy to a new temp file\n  - `\u003e 64KB`: share backing file with offset/length view\n\n## Installation\n\n```bash\ndart pub add block\n```\n\n## API\n\n```dart\nimport 'package:block/block.dart';\n\nFuture\u003cvoid\u003e main() async {\n  final block = Block([\n    'hello ',\n    'world',\n  ], type: 'text/plain');\n\n  final size = block.size;\n  final type = block.type;\n\n  final bytes = await block.arrayBuffer();\n  final text = await block.text();\n\n  final slice = block.slice(0, 5);\n\n  await for (final chunk in block.stream(chunkSize: 1024)) {\n    // handle chunk\n  }\n}\n```\n\nSupported constructor part types:\n\n- `String`\n- `Uint8List`\n- `ByteData`\n- `Block`\n\nAdditional web-only part types:\n\n- `web.Blob`\n- `web.File`\n\n## Breaking Reset in 1.0.0\n\nThis release intentionally removes the previous memory/cache/dedup framework APIs and keeps only the Blob-style core contract.\n\n## License\n\nBSD-style. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedz%2Fblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedz%2Fblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedz%2Fblock/lists"}