hlx-terminator
v0.0.5
Published
A writable stream to write hls data to nowhere (/dev/null)
Downloads
13
Readme
hlx-terminator
A writable stream to write hls data to nowhere (/dev/null)
Features
- Being used with other
hlx
objects, it provides a functionality to terminate the stream pipeline.
Install
Usage
const {createReadStream} = require('hlx-file-reader');
const {createLogger} = require('hlx-logger');
const {createTerminator} = require('hlx-terminator'); // terminator
const src = createReadStream('https://foo.bar/sample.m3u8');
const logger = createLogger({
level: 'detail'
});
const dest = createTerminator();
// Print all playlists/segments to stdout
src.pipe(logger).pipe(dest)
.on('error', err => {
console.log(err.stack);
});
API
The features are built on top of the Node's Writable Stream
.
createTerminator()
Creates a new WriteStream
object.
params
None
return value
An instance of WriteStream.
WriteStream
A subclass of stream.Writable that just ignore every hls-parser
objects.