{"id":16641595,"url":"https://github.com/scrwdrv/bua","last_synced_at":"2026-04-22T11:06:12.948Z","repository":{"id":57159039,"uuid":"236181254","full_name":"scrwdrv/bua","owner":"scrwdrv","description":"Backup archive, as a tar alternative.","archived":false,"fork":false,"pushed_at":"2020-02-05T14:32:06.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T22:49:11.952Z","etag":null,"topics":["archive","archiver","backup","extract","packer","rar","tar","zip"],"latest_commit_sha":null,"homepage":null,"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/scrwdrv.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":"2020-01-25T14:32:35.000Z","updated_at":"2020-02-05T14:32:09.000Z","dependencies_parsed_at":"2022-09-08T09:02:22.975Z","dependency_job_id":null,"html_url":"https://github.com/scrwdrv/bua","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scrwdrv/bua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fbua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fbua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fbua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fbua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scrwdrv","download_url":"https://codeload.github.com/scrwdrv/bua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fbua/sbom","scorecard":{"id":806526,"data":{"date":"2025-08-11","repo":{"name":"github.com/scrwdrv/bua","commit":"b7346fc6d857d88bceb6c9eac09c1d9b12b55b84"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T11:56:01.730Z","repository_id":57159039,"created_at":"2025-08-23T11:56:01.730Z","updated_at":"2025-08-23T11:56:01.730Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32132977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["archive","archiver","backup","extract","packer","rar","tar","zip"],"created_at":"2024-10-12T07:47:10.960Z","updated_at":"2026-04-22T11:06:12.930Z","avatar_url":"https://github.com/scrwdrv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bua\n Backup archive, as a tar alternative.\n\n## Installation\n```sh\nnpm i bua\n```\n\n## Header\nbua's format is relatively simple, header contains the following:\n \n| Header        |Optional | Value                | Description                                        |\n|:--------------|:-------:|:--------------------:|:--------------------------------------------------:|\n|name           | `false` |`string`              | Basically relative path of this directory or file  |\n|size           | `false` |`number`              | Size in bytes of this file, directory is `0`       |\n|mtime          | `true`  |`number`              | Last modified time in ms                           |\n|mode           | `true`  |`number`              | File mode, usually permission                      |\n|type           | `false` |file \\| directory     | Type is either file or directory                   |\n\n## Usage\nbua uses stream on both packing and extracting, it is the most efficient way to transform and transmit data. Also allow you to pipe bua stream to `fs`, `cipher`, `socket`, etc. easily.\n### Pack\nHere is a simple example of packing `node_modules` to a single `.bua` file.\n```js\nimport * as bua from 'bua';\nimport * as fs from 'fs';\n\nconst pack = new bua.Pack();\n\nLetsPack('node_modules', (err) =\u003e {\n    if (err) return console.log(err);\n    pack.finalize(); // emit eof to the stream\n});\n\n//pipe output stream to a fs writeStream\npack.output.pipe(fs.createWriteStream('node_modules.bua')).on('finish', () =\u003e {\n    console.log('packed');\n});\n\nfunction LetsPack(path, cb) {\n    fs.stat(path, (err, stats) =\u003e {\n        if (err) return cb(err);\n        if (stats.isDirectory()) {\n            // due to there is no data to write for a directory, \n            // you can simply `writeHeader` without creating a stream\n            pack.writeHeader({\n                name: path,\n                size: 0,\n                mtime: Math.floor(stats.mtimeMs),\n                mode: stats.mode,\n                type: 'directory'\n            });\n            // read directory recursively\n            fs.readdir(path, (err, files) =\u003e {\n                if (err)\n                    return cb(err);\n                const l = files.length;\n                (function next(i = 0) {\n                    if (i === l)\n                        return cb(null);\n                    LetsPack(PATH.join(path, files[i]), (err) =\u003e {\n                        if (err)\n                            return cb(err);\n                        next(i + 1);\n                    });\n                })();\n            });\n        }\n        else if (stats.isFile())\n            // pipe the original file to `pack.entry` with header\n            fs.createReadStream(path)\n                .pipe(pack.entry({\n                name: path,\n                size: stats.size,\n                mtime: Math.floor(stats.mtimeMs),\n                mode: stats.mode,\n                type: 'file'\n            }, cb));\n        else cb(null);\n    });\n}\n```\n\n### Extract\nExtract a `.bua` file to file system with original folder structure.\n```js\nextract = new bua.Extract();\n\n// callback on entry found\nextract.entry((header, stream, next) =\u003e {\n    const time = new Date(header.mtime);\n    header.name = header.name.replace(/^node_modules/, 'node_modules_bua');\n    if (header.type === 'file')\n        // pipe original data to fs writeStream\n        stream.pipe(fs.createWriteStream(header.name, { mode: header.mode || 0o644 })).on('finish', () =\u003e \n            // restore mtime\n            fs.utimes(header.name, 0, time, (err) =\u003e {\n                if (err) return next(err);\n                next();\n            })\n        );\n    else\n        (function dirHandler() {\n\n            // to prevent mkdir finished before stream is drained and call `next` too early\n            let dirMked = false,\n                streamDrained = false;\n\n            // `stream.skip` to drain the stream since there is no data to write for a directory \n            stream.skip(() =\u003e {\n                // if mkdir has finished then `next` \n                if (dirMked) return next();\n                streamDrained = true;\n            });\n\n            fs.mkdir(header.name, { recursive: true, mode: header.mode || 0o755 }, (err) =\u003e {\n                if (err) return next(err);\n                // restore mtime\n                fs.utimes(header.name, 0, time, (err) =\u003e {\n                    if (err) return next(err);\n                    // if stream has drained then `next` \n                    if (streamDrained) return next();\n                    dirMked = true;\n                });\n            });\n        })();\n});\n\n\n//pipe fs readStream to input stream\nfs.createReadStream('node_modules.bua').pipe(extract.input).on('finish', () =\u003e {\n    console.log('extracted', PATH.resolve('node_modules_bua'));\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrwdrv%2Fbua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrwdrv%2Fbua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrwdrv%2Fbua/lists"}