Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hlx-file-writer

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hlx-file-writer

A writable stream to save HLS playlists/segments as local files

  • 0.0.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage Status Dependency Status Development Dependency Status Known Vulnerabilities XO code style

hlx-file-writer

A writable stream to save HLS playlists/segments as local files

Features

Install

NPM

Usage

const {createReadStream} = require('hlx-file-reader');
const {createUrlRewriter} = require('hlx-url-rewriter');
const {createWriteStream} = require('hlx-file-writer'); // file-writer
const {createTerminator} = require('hlx-terminator')

const src = createReadStream('https://foo.bar/sample.m3u8');
const rewrite = createUrlRewriter();
const save = createWriteStream({
  outputDir: '/var/www/media/',
  storePlaylist: true
});
const dest = createTerminator();

// Write all playlists/segments to your local filesystem
src.pipe(rewrite).pipe(save).pipe(dest)
.on('error', err => {
  console.log(err.stack);
});

API

The features are built on top of the Node's transform streams.

createWriteStream([options])

Creates a new TransformStream object.

params
NameTypeRequiredDefaultDescription
optionsobjectNo{}See below
options
NameTypeDefaultDescription
inputDirstring/The root directory from which all the files are read (This option is only used in case of file urls)
outputDirstringprocess.CWD()The root directory to which all the files are written
storePlaylistbooleanfalseIf true, the playlist files are also stored as local files
return value

An instance of TransformStream.

Keywords

FAQs

Package last updated on 28 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc