iostreams

Open input and output streams given providers and small config

IOStreams

Quick amnd easy input & output streams from a bit of JSON.

Get an input stream from the filesystem, compile your stylus and output stream to S3.

iostreams.getInputOutputStreams(
  'file:' + __dirname + '/stylus/style.stylus',
  's3://mybucket.s3.amazonaws.com/css/style.css'
, function (errinputStreamoutputStream) {
  if(err) throw err;
  inputStream.pipe(require('gulp-stylus')).pipe(outputStream);
});

First you're going to need to import the module, and create an instance (by calling as a function):

var ioStreams = require('iostreams')();

Then add some providers

iostreams.use(require('iostreams-file'));
iostreams.use(require('iostreams-s3'));
iostreams.use(require('iostreams-http'));
iostreams.use(require('iostreams-https'));

Now you can use the three functions to get your input and output streams:

iostreams.getInputStream(config, function(errinputStream) { });
iostreams.getOutputStream(config, function(erroutputStream) { });
iostreams.getInputOutputStreams(inputConfig, outputConfig, function(errinputStreamoutputStream) { });

config, inputConfig & outputConfig can be objects or URIs (strings).

MIT