1.0.1 • Published 7 years ago

sg-file v1.0.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

sg-file

Build Status npm Version JS Standard

File utility

Installation

$ npm install sg-file --save

Usage

'use strict'

const { saveStream } = require('sg-file')
const co = require('co')
const fs = require('fs')

co(function * () {
  let stream = fs.createReadStream('foo.txt')
  yield saveStream('copies/foo-copy.txt', stream)
}).catch((err) => console.error(err))

Functions

Available functions

SignatureDescription
saveStream(filename, stream, options) -> PromiseSave stream into file

License

This software is released under the Apache-2.0 License.

Links