README
Node-Archive-Manager
A Node.js plugin to manipulate archive files using C++ and libarchive
Installation
This requires node-gyp to compile, you can get it here. There are some quirks to installing node-gyp for windows, please follow the instructions in the link carefully
As per usual, use your node package manager of choice to install this in your project:
yarn install archive-manager
Usage
Here is a basic use case:
const ArchiveManager = require('archive-manager');
ArchiveManager.Content('path/to/archive', function(error, files){
if(error){
console.error(error);
return;
}
files.forEach(function(file){
console.log(file.name);
});
});
API
There are six functions in this module:
Content()
Create()
Append()
Extract()
Read()
Remove()
For more detail view the wiki
Building From Source
For Windows
The libarchive package and its dependencies are provied for both 64 and 32 bit windows, but you may need to grab some extra things for node-gyp (see above):
yarn install
node-gyp rebuild
For Linux
For linux distributions, install the libarchive development package using your chosen packge manager, eg:
sudo apt-get install libarchive-dev
Then
yarn install
node-gyp rebuild