File size: 539 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import * as fs from 'graceful-fs';
import { dirname } from 'path';
import mkdirp from 'mkdirp';
import resolvePathAndOptions from '../utils/resolvePathAndOptions';
export function createReadStream () {
const { resolvedPath, options } = resolvePathAndOptions( arguments );
return fs.createReadStream( resolvedPath, options );
}
export function createWriteStream () {
const { resolvedPath, options } = resolvePathAndOptions( arguments );
mkdirp.sync( dirname( resolvedPath ) );
return fs.createWriteStream( resolvedPath, options );
} |