1.0.0 • Published 9 years ago

stream-newline v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

stream-newline Build Status

Ensure stream ends with a newline

Usage

var streamNewline = require("stream-newline")

// A stream that may or may not have a newline at the end
var fileStream = fs.createReadStream("README.txt")

// Pipe fileStream to stdout and guarantee a newline at the end
fileStream.pipe(streamNewline()).pipe(process.stdout)

API

streamNewline(opts)

Creates a new stream that ensures there will be a newline at the end. The optional opts argument is an options object that can contain the following properties:

  • eol: A custom end-of-line sequence. Defaults to os.EOL (will be \n on POSIX, \r\n on Windows).