{"id":14984957,"url":"https://github.com/blackaslight/tar-stream","last_synced_at":"2025-11-03T04:30:40.223Z","repository":{"id":248801374,"uuid":"829821310","full_name":"BlackAsLight/tar-stream","owner":"BlackAsLight","description":"A ustar format implementation of Tar based off the FreeBSD 15.0 spec.","archived":true,"fork":false,"pushed_at":"2024-08-06T11:17:03.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T18:11:17.635Z","etag":null,"topics":["browser","deno","javascript","stream","tar","typescript","untar"],"latest_commit_sha":null,"homepage":"https://jsr.io/@doctor/tar-stream","language":"TypeScript","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/BlackAsLight.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-17T04:16:48.000Z","updated_at":"2024-10-14T04:09:38.000Z","dependencies_parsed_at":"2024-09-29T18:40:37.450Z","dependency_job_id":null,"html_url":"https://github.com/BlackAsLight/tar-stream","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.2222222222222222,"last_synced_commit":"57a49378d30f64aebe5e15cefef16e76c1bb8541"},"previous_names":["blackaslight/tar-stream"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackAsLight%2Ftar-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackAsLight%2Ftar-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackAsLight%2Ftar-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackAsLight%2Ftar-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackAsLight","download_url":"https://codeload.github.com/BlackAsLight/tar-stream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412434,"owners_count":19634013,"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":["browser","deno","javascript","stream","tar","typescript","untar"],"created_at":"2024-09-24T14:09:55.209Z","updated_at":"2025-11-03T04:30:40.111Z","avatar_url":"https://github.com/BlackAsLight.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tar Stream\n\nTar Stream is an implementation made from scratch following the\n[FreeBSD 15.0](https://man.freebsd.org/cgi/man.cgi?query=tar\u0026apropos=0\u0026sektion=5\u0026manpath=FreeBSD+15.0-CURRENT\u0026arch=default\u0026format=html)\nspec.\n\n## File Format + Limitations\n\nThis implementation follows the ustar file format for creating and expanding\nTarballs. While this format is compatible with most tar implementations, the\nformat does have several limitations, including:\n\n- Pathnames cannot exceed 256 characters.\n  - If the pathname exceeds 100 characters, it must be split-able on a forward\n    slash `/` so each side does not exceed 155 and 100 characters respectively.\n- Files can't exceed a size of 64 GiBs.\n  - If a file size exceeds 8 GiBs then the size extension will be automatically\n    enabled allowing up to 64 GiBs per size, but this might exclude it from\n    being expanded by older implementations of Tar that don't support the size\n    extension.\n- Spares files are not supported.\n\n## Compression\n\nTar doesn't offer compression by default, so if you'd like to compress the\nTarball, you may do so by piping it through a compression stream.\n\n## Example in creating a tarball.\n\n```ts\nimport { type TarFile, TarStream } from '@doctor/tar-stream'\n\nawait ReadableStream.from(readDir('./'))\n  .pipeThrough(\n    new TransformStream\u003cstring, TarFile\u003e({\n      async transform(chunk, controller) {\n        if (chunk.endsWith('.ts')) {\n          controller.enqueue({\n            pathname: chunk,\n            size: (await Deno.stat(chunk)).size,\n            iterable: (await Deno.open(chunk)).readable,\n          })\n        }\n      },\n    }),\n  )\n  .pipeThrough(new TarStream())\n  .pipeThrough(new CompressionStream('gzip'))\n  .pipeTo((await Deno.create('./archive.tar.gz')).writable)\n\nasync function* readDir(path: string): AsyncGenerator\u003cstring\u003e {\n  if (!path.endsWith('/')) {\n    path += '/'\n  }\n  for await (const dirEntry of Deno.readDir(path)) {\n    if (dirEntry.isFile) {\n      yield path + dirEntry.name\n    } else if (dirEntry.isDirectory) {\n      for await (const filePath of readDir(path + dirEntry.name)) {\n        yield filePath\n      }\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackaslight%2Ftar-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackaslight%2Ftar-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackaslight%2Ftar-stream/lists"}