How to use the memorystream.createWriteStream function in memorystream

To help you get started, we’ve selected a few memorystream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github acarl / pg-restify / test / helper.js View on Github external
exports.fullServerPath = 'http://localhost:' + exports.serverPort;

exports.request = request(exports.fullServerPath);


//TODO:parameterize the connection string and server port
exports.pgConfig = {
  connectionString: 'pg://postgres@localhost/pg_restify'
};
exports.invalidpgConfig = {
  connectionString: 'pg://postgres@localhost/pg_restify_invalid'
};

exports.pgRestifyInstance = null;

exports.logWriter = MemoryStream.createWriteStream();


exports.initDefaultServer = function(next) {

  if (exports.pgRestifyInstance) {
    // if already initialize just return the cached instance
    return next(null, exports.pgRestifyInstance);
  }

  var log = bunyan.createLogger({
    name: 'node-rest-api',
    stream: exports.logWriter,// comment out this line for errors to log to the console
    level: 'error'
  });

  var server = restify.createServer({log:log});

memorystream

This is lightweight memory stream module for node.js.

MIT
Latest version published 10 years ago

Package Health Score

67 / 100
Full package analysis