Skip to content

Repository files navigation

Ishtar LicenseNPM versionDependency Status

pack and extract .tar.gz archives middleware based on socket.io and jaguar.

Install

npm i ishtar --save

Client

Could be loaded from url /ishtar/ishtar.js.

constprefix='/ishtar';/* could be one argument: callback */ishtar(prefix,function(packer){constfrom='/';constto='/tmp';constnames=['bin'];constprogress=(value)=>{console.log('progress:',value);},constend=()=>{console.log('end');packer.removeListener('progress',progress);packer.removeListener('end',end);};packer.pack(from,to,names);packer.on('progress',progress);packer.on('end',end);packer.on('error',(error)=>{console.error(error.message);});});

Server

constishtar=require('ishtar');consthttp=require('http');constexpress=require('express');constio=require('socket.io');constapp=express();constport=1337;constserver=http.createServer(app);constsocket=io.listen(server);server.listen(port);app.use(ishtar({online: true,authCheck: function(socket,success){}});ishtar.listen(socket,{prefix: '/ishtar',/* default */root: '/',/* string or function */});

Environments

In old node.js environments that supports es5 only, dword could be used with:

varishtar=require('ishtar/legacy');

Related

  • Salam - Pack and extract zip archives middleware.

License

MIT

About

pack and extract .tar.gz archives middleware

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages