require-stream

A stream that requires modules

npm install require-stream
1 downloads in the last week
4 downloads in the last month

Require stream

This stream receives module paths and emits the imported modules

var requireStream = require("require-stream");
var JSONStream    = require("JSONStream");
var eventStream   = require("event-stream");

var lineStream = eventStream.map(function(line, next) {
  next(false, line + "\n")
});

stream = requireStream();

stream.pipe(JSONStream.stringify(false)).pipe(lineStream).pipe(process.stdout);
stream.write("test");
stream.write("export");
stream.end()

requireStream()

The stream requireStream() function takes no arguments to initialize it and it just returns an instance of a require stream that reveives module paths and emits the imported modules

  • @returns {stream} - The module importing stream
npm loves you