Skip to content

Repository files navigation

Salam LicenseNPM versionDependency StatusBuild Status

Pack and extract zip archives middleware based on socket.io and onezip.

Install

npm i salam --save

Client

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

constprefix='/salam';salam(prefix,(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

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

Environments

In old node.js environments that not fully supports es2015, salam could be used with:

varsalam=require('salam/legacy');

Related

  • Ishtar - Pack and extract .tar.gz archives middleware.

License

MIT

About

pack and extract zip archives middleware

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages