# winrarjs

> rarlab api for node js

Latest version **0.0.17** (published 2021-02-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install winrarjs
pnpm add winrarjs
yarn add winrarjs
bun add winrarjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.17 |
| Published | 2021-02-24 |
| First published | 2017-04-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 831.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | fauzandotme |
| Maintainers | fauzandotme |
| Keywords | rar, unrar, rarlab, winrar |

## Links

- npm: https://www.npmjs.com/package/winrarjs
- Repository: https://github.com/fauzandotme/rarjs
- Homepage: https://github.com/fauzandotme/rarjs#readme
- Issues: https://github.com/fauzandotme/rarjs/issues
- npm.io page: https://npm.io/package/winrarjs

## Dependencies (3)

- [mime](https://npm.io/package/mime.md) ^1.3.4
- [file-exists](https://npm.io/package/file-exists.md) ^3.0.2
- [shell-escape](https://npm.io/package/shell-escape.md) ^0.2.0

## Recent versions

- 0.0.17 (latest) — 2021-02-24
- 0.0.16 — 2017-04-19
- 0.0.15 — 2017-04-15
- 0.0.14 — 2017-04-13
- 0.0.13 — 2017-04-12
- 0.0.12 — 2017-04-11
- 0.0.11 — 2017-04-11
- 0.0.10 — 2017-04-11
- 0.0.9 — 2017-04-10
- 0.0.8 — 2017-04-10
- 0.0.7 — 2017-04-10
- 0.0.6 — 2017-04-04
- 0.0.5 — 2017-04-03
- 0.0.4 — 2017-04-03
- 0.0.3 — 2017-04-01
- … 2 more at https://npm.io/package/winrarjs/versions

## README

WinrarJs
===================

##How to Use?
    const Winrar = require('winrarjs');

###Use installed rar
    var winrar = new Winrar('/path/to/file/test.txt');
    winrar.isRarInstalled(true|false) // if installed, we'r gonna use it. This will fix compability issue. Because the included rar & unrar app in this package is for linux.


###Create rar file

    var winrar = new Winrar('/path/to/file/test.txt');
    // add another files
    winrar.addFile('/path/to/file/test2.txt');

    // add multiple file
    winrar.addFile(['/path/to/file/test2.txt', '/path/to/file/test2.txt']);

    // set output file
    winrar.setOutput('/path/to/output/output.rar');

    // set options
    winrar.setConfig({
    	password: 'testPassword',
    	comment: 'rar comment',
    	volumes: '10',  // split volumes in Mega Byte
    	deleteAfter: false, // delete file after rar proccess completed
    	level: 0 // compression level 0 - 5
    });

    // archiving file
    winrar.rar().then((result) => {
    	console.log(result);
    }).catch((err) => {
    	console.log(err);
    }

###Read rar file

    var winrar = new Winrar('/path/to/file/test.rar');

    // Read rar files
    winrar.listFile().then((result) => {
      console.log(result);
    }).catch((err) => {
      console.log(err);
    }

###Extract rar archive

        var winrar = new Winrar('/path/to/file/test.txt');

        // set output folder
        winrar.setOutput('/path/to/output/folder');

        // set list of files in rar file that you wan't to extract
        winrar.setArchiveFile(['file1.txt', 'file2.txt', 'folder/file1.txt']);

        //or
        winrar.setArchiveFile('file1.txt');

        // set options
        winrar.setConfig({
        	password: 'rarPassword',
        	deleteAfter: false, // delete file after file extracted
        	keepBroken: true, //keep broken files
        });

        // extracting files
        winrar.unrar().then((result) => {
        	console.log(result);
        }).catch((err) => {
        	console.log(err);
        }

##Contact Me
[fb.com/fauzan.tolis](https://fb.com/fauzan.tolis)

---
_Source: https://npm.io/package/winrarjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
