You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

save-to

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

save-to

Save a stream to a file

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
76
-16.48%
Maintainers
1
Weekly downloads
 
Created
Source

Save to ______ Build Status

Save a stream to a file.

API

var saveTo = require('save-to')
var stream = fs.createReadStream('some file.txt')

saveTo(stream, 'destination.txt', function (err, destination) {
  if (err) throw err
})

saveTo(stream [, destination] [, options], callback)

  • stream is the source stream, for example a request.
  • destination is the path where the stream will be saved.
  • callback(err, destination)

The options are:

  • destination - if you don't specify destination as an argument.
  • length - expected byte length. Throws an error if it does not match the stream's length.
  • limit - maximum byte length. Throws an error if the stream is larger than this size.

FAQs

Package last updated on 14 May 2014

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