diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 0919ef1b08..80655ab5b8 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -45,6 +45,7 @@ var openOpts: fs.OpenOptions; var watcher: fs.FSWatcher; var readStreeam: stream.Readable; var writeStream: stream.Writable; +var outputStream: stream.Writable; fs.copy(src, dest, errorCallback); fs.copy(src, dest, (src: string) => { @@ -150,7 +151,7 @@ strArr = fs.readdirSync(path); fs.close(fd, errorCallback); fs.closeSync(fd); fs.open(path, flags, modeStr, (err: Error, fd: number) => { - + }); num = fs.openSync(path, flags, modeStr); fs.utimes(path, atime, mtime, errorCallback); @@ -217,6 +218,17 @@ fs.exists(path, (exists: boolean) => { }); bool = fs.existsSync(path); +fs.ensureDir(path, errorCallback); +fs.ensureDirSync(path); +fs.ensureFile(path, errorCallback); +fs.ensureFileSync(path); +fs.ensureLink(path, errorCallback); +fs.ensureLinkSync(path); +fs.ensureSymlink(path, errorCallback); +fs.ensureSymlinkSync(path); +fs.emptyDir(path, errorCallback); +fs.emptyDirSync(path); + readStreeam = fs.createReadStream(path); readStreeam = fs.createReadStream(path, { flags: str, @@ -231,3 +243,9 @@ writeStream = fs.createWriteStream(path, { encoding: str, string: str }); +outputStream = fs.createOutputStream(path); +outputStream = fs.createOutputStream(path, { + flags: str, + encoding: str, + string: str +}); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index 852956a71b..d997d12a89 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -167,6 +167,15 @@ declare module "fs-extra" { export function exists(path: string, callback?: (exists: boolean) => void ): void; export function existsSync(path: string): boolean; export function ensureDir(path: string, cb: (err: Error) => void): void; + export function ensureDirSync(path: string): void; + export function ensureFile(path: string, cb: (err: Error) => void): void; + export function ensureFileSync(path: string): void; + export function ensureLink(path: string, cb: (err: Error) => void): void; + export function ensureLinkSync(path: string): void; + export function ensureSymlink(path: string, cb: (err: Error) => void): void; + export function ensureSymlinkSync(path: string): void; + export function emptyDir(path: string, callback?: (err: Error) => void): void; + export function emptyDirSync(path: string): boolean; export interface OpenOptions { encoding?: string; @@ -192,4 +201,5 @@ declare module "fs-extra" { } export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; + export function createOutputStream(path: string, options?: WriteStreamOptions): WriteStream; }