mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-03 05:19:30 +08:00
16 lines
No EOL
539 B
Text
16 lines
No EOL
539 B
Text
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 );
|
|
} |