@anzerr/file.stream

pipe files over socket

Usage no npm install needed!

<script type="module">
  import anzerrFileStream from 'https://cdn.skypack.dev/@anzerr/file.stream';
</script>

README

Intro

GitHub Actions status | linter GitHub Actions status | publish GitHub Actions status | test

A client and server to handle streaming files with pipes and remove them from a remote server

Install

npm install --save git+https://github.com/anzerr/file.stream.git
npm install --save @anzerr/file.stream

Example

const sync = require('file.stream');

let port = 5936;
new sync.Server(process.cwd(), 'localhost:' + port);
let client = new sync.Client('localhost:' + port);
fs.createReadStream('./example.js')
    .pipe(client.createUploadStream('example1.js'))
    .on('close', () => {
        client.remove('example1.js').then(() => {
            console.log('removed file');
        });
    });