Graduation / ui /node_modules /sander /src /specialMethods /createReadStream-createWriteStream.js
DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
raw
history blame
539 Bytes
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 );
}