streamcatcher

1.0.1 • Public • Published

streamcatcher

Capture a http stream for a duration of time

usage

Create a StreamCatcher object with the following parameters:

url {string} the url of the http stream to capture

duration {string} how long to capture (Moment duration string: see https://momentjs.com/docs/#/durations/creating/)

basename {string} the file name without path and without extension

dirTmp {string} where to save the stream to until capture is complete

dirToSaveTo {string} where to save the file finally when capture is complete

logger {logger} the logger object

const url = 'http://pri.gocaster.net/td4';
const streamCatcher = new StreamCatcher(url, "PT3S", 'testdownload', 'test/tmp/down', 'test/tmp/final', console);
streamCatcher.execute()
  .then((filename) => fs.stat(filename))
  .then((stats) => console.log(filename.size + " bytes captured!"))

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i streamcatcher

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • davelane