save-to

Save a stream to a file

MIT 12 个版本
安装
npm install save-to
yarn add save-to
pnpm add save-to
bun add save-to
README

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.
版本列表
1.0.3 2014-05-14
1.0.2 2013-12-02
1.0.1 2013-12-01
1.0.0 2013-11-27
0.3.1 2013-11-17
0.3.0 2013-11-17
0.1.0 2013-11-11
0.0.5 2013-10-10
0.0.4 2013-10-03
0.0.3 2013-10-03
0.0.2 2013-10-03
0.0.1 2013-10-03