Archive. Date of access: 12 Jan 2022
Marak 6e57ad3f9f [docs] Update README | 8 anos atrás | |
---|---|---|
bin | 10 anos atrás | |
examples | 10 anos atrás | |
lib | 10 anos atrás | |
test | 10 anos atrás | |
.gitignore | 10 anos atrás | |
README.md | 8 anos atrás | |
index.js | 10 anos atrás | |
package.json | 10 anos atrás |
Package | vinyl-http |
Description | Vinyl adapter for HTTP |
Node Version | >= 0.10 |
This vinyl adapter allows you to either either post or receive streams of vinyl from an HTTP server.
This enables the ability to quickly push or retrieve streams of files to or from remote sources.
An HTTP server component is required and shipped with this module. It can be used as a stand-alone server or as middleware for your existing http server.
Alternatives to using this module could be gulp-sftp
, but that would necessitate an open ssh server while vinyl-http
requires only an open http server.
var server = require('vinyl-http').createServer();
server.listen(8888);
var vhttp = require('../index');
var vfs = require('vinyl-fs');
var map = require("map-stream");
var log = function(file, cb) {
console.log(file)
cb(null, file);
};
vfs.src('test/fixtures/**')
.pipe(vhttp.dest('http://localhost:8888/upload'))
.pipe(map(log));
var vhttp = require('../index');
var vfs = require('vinyl-fs');
var map = require("map-stream");
var log = function(file, cb) {
console.log(file)
cb(null, file);
};
vhttp.src('http://localhost:8888/test/fixtures/**')
.pipe(map(log))
.pipe(vfs.dest('./download'));
var vhttp = require('../index');
var vfs = require('vinyl-fs');
var map = require("map-stream");
var log = function(file, cb) {
console.log(file)
cb(null, file);
};
vhttp.src('http://localhost:8888/test/fixtures/**')
.pipe(map(log))
.pipe(vhttp.dest('http://localhost:8888/upload2'));