1.0.17 • Published 2 years ago

@anzerr/file.stream v1.0.17

Weekly downloads
11
License
MIT
Repository
github
Last release
2 years ago

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');
		});
	});