2.0.5 • Published 7 years ago

ishtar v2.0.5

Weekly downloads
83
License
MIT
Repository
github
Last release
7 years ago

Ishtar License NPM version Dependency 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.

const prefix = '/ishtar';

/* could be one argument: callback */
ishtar(prefix, function(packer) {
    const from = '/';
    const to = '/tmp';
    const names = [
        'bin'
    ];
    const progress = (value) => {
        console.log('progress:', value);
    },
    
    const end = () => {
        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

const ishtar = require('ishtar');
const http = require('http');
const express = require('express');
const io = require('socket.io');
const app = express();
const port = 1337;
const server = http.createServer(app);
const socket = 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:

var ishtar = require('ishtar/legacy');

Related

  • Salam - Pack and extract zip archives middleware.

License

MIT

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.5.8

7 years ago

1.5.7

7 years ago

1.5.6

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.3

8 years ago

1.5.2

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago