New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

stream-save

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-save

`npm i --save https://github.com/Israfil22/stream-save.git`

latest
Source
npmnpm
Version
1.1.203
Version published
Maintainers
1
Created
Source

StreamSaver

As package using

npm i --save https://github.com/Israfil22/stream-save.git

or

npm i --save stream-save

In code:

const createDownloader = requie('stream-saver')

const downloader = createDownloader()

const MB_SIZE_DIVISOR = 1024 * 1024

downloader.onStart((total) => {
    console.log(`Total file size: ${total / MB_SIZE_DIVISOR}`)
})

downloader.onPart((total, current) => {
    console.log(`Percents: ${current / total * 100}%`)
})

downloader.onEnd((total) => {
    console.log('End')
})

downloader.download(process.env.URL, process.env.FILE)
    .then((total) => {
        console.log(`Success! Total file size: ${total / MB_SIZE_DIVISOR}`)
    })
    .catch((e) => {
        console.log(e)
        process.exit(1)
    })

Install / Build

  • Install Node.js
    In shell / cmd
  • npm i -g pkg
  • npm i
  • npm run pack

Your build will be located at ./dist folder

Mode

Without flags specifying

Source url & destination url will be prompted from console

Bulk flag

Example: streamsaver.exe bulk list=all.json

Sources will be taken from list execute argument.

list.json file structure:

[
    {
        "src": "https://url_1.webm",
        "dst": "file_record_1.webm"
    },
    {
        "src": "https://url_2.webm",
        "dst": "file_record_2.webm"
    }
]

FAQs

Package last updated on 26 Dec 2020

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