{"id":22938076,"url":"https://github.com/sandy98/node-rarfile","last_synced_at":"2025-08-12T18:32:33.451Z","repository":{"id":8375705,"uuid":"9946178","full_name":"sandy98/node-rarfile","owner":"sandy98","description":"Utility to handle RAR archives within node.js","archived":false,"fork":false,"pushed_at":"2014-10-28T05:12:02.000Z","size":1156,"stargazers_count":9,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-20T07:25:38.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/sandy98.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":"2013-05-08T21:18:15.000Z","updated_at":"2017-07-29T23:24:55.000Z","dependencies_parsed_at":"2022-07-31T00:17:54.726Z","dependency_job_id":null,"html_url":"https://github.com/sandy98/node-rarfile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandy98%2Fnode-rarfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandy98%2Fnode-rarfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandy98%2Fnode-rarfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandy98%2Fnode-rarfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandy98","download_url":"https://codeload.github.com/sandy98/node-rarfile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229699827,"owners_count":18109856,"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-12-14T12:15:56.842Z","updated_at":"2024-12-14T12:15:57.424Z","avatar_url":"https://github.com/sandy98.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-rarfile\n      \nUtility for handling rarfile archives using [node](http://nodejs.org).\n\n\n\n## Example\n\n    var rarfile = require('rarfile');\n    var rf = new rarfile.RarFile('./test/test.cbr');\n    console.log(rf.toString());\n      // { names: [ '0.jpg', '2.jpg']}\n    \n    //readFile function\n    rf.readFile('0.jpg', function(err, fdata) {\n      console.log(\"File 0.jpg is \" + fdata.length + \" bytes long.\");\n    });\n\n    //pipe function. New in v0.1.4\n    var fs = require('fs');\n    var outfile = fs.createWriteStream('2_copy.jpg');\n    rf.pipe('2.jpg', outfile);\n    });\n\n\n## Depends\n\n * node v0.8 and above\n\n * unrar free tool being in the path, as all\nits inner workings (with the exception of isRarFile function) relay on\nspawning unrar as a child process. As such, it's guaranteed to work on\n\u003cstrong\u003e*nix\u003c/strong\u003e systems which have unrar installed. Should work on Windows provided\nunrar is installed and it's executable is in the path. This has been recently tested,\n\n * [when](https://github.com/cujojs/when) asyncronous library.\n \n\n## Installation\n\nInstall via npm:\n\n    npm install rarfile\n\n## API\n\nnode-rarfile module exports an object which exposes 3 properties\n\n* \u003cstrong\u003eVERSION\u003c/strong\u003e Current module version.\n\n* \u003cstrong\u003eisRarFile\u003c/strong\u003e function, which may be used to test if a file is RAR compressed\n\n* \u003cstrong\u003eRarFile\u003c/strong\u003e object, which must be instantiated with a RAR file path, otherwise will throw an error, \n  and which features the following properties:\n\n    * \u003cstrong\u003enames\u003c/strong\u003e (Object): an array containing the names of the archived files\n\n    * \u003cstrong\u003ereadStream\u003c/strong\u003e (Function): called with the file which data will be retrieved, returns the output stream of unrar child process, which may be piped\n      to another stream or whatever use you see fit. There are some issues remaining for binary data (i.e. images)\n\n    * \u003cstrong\u003ereadFile\u003c/strong\u003e (Function): must be called with two parameters:\n\n       * 1) Name of a file within the archive \n\n       * 2) A callback function meant to handle the file data.\n\n    * \u003cstrong\u003epipe\u003c/strong\u003e (Function): meant to make RarFile instances to behave like a ReadStream, it takes an additional (first)\n      parameter, the name of the archived file to be piped, thus relegating the name of the write stream to the \n      second formal parameter. (See the previous example)\n    \n## Motivation\n\nFor one thing, I couldn't find a node.js unrar utility along the lines of \n[node-zipfile](https://github.com/springmeyer/node-zipfile), and thought one should be available.\n\nIt's worth noting though, that in spite of trying to make an API as close as was possible to the aforementioned, the inner workings of both\nare very different. \n\nnode-zipfile is a much more complete piece of software, as you can easily figure out by examining the source codes of both.\nnode-rarfile is just a thin wrapper around unrar, anyway I hope it may be useful. \n    \n\n## License\n\n  MIT, see LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandy98%2Fnode-rarfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandy98%2Fnode-rarfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandy98%2Fnode-rarfile/lists"}