@types/fs-extra
- Version 9.0.13
- Published
- 27.9 kB
- 1 dependency
- MIT license
Install
npm i @types/fs-extra
yarn add @types/fs-extra
pnpm add @types/fs-extra
Overview
TypeScript definitions for fs-extra
Index
Variables
Functions
- access()
- appendFile()
- chmod()
- chown()
- close()
- copy()
- copyFile()
- copySync()
- createFile()
- createFileSync()
- createSymlink()
- createSymlinkSync()
- emptyDir()
- emptyDirSync()
- ensureDir()
- ensureDirSync()
- ensureFile()
- ensureFileSync()
- ensureLink()
- ensureLinkSync()
- ensureSymlink()
- ensureSymlinkSync()
- fchmod()
- fchown()
- fdatasync()
- fstat()
- fsync()
- ftruncate()
- futimes()
- lchown()
- link()
- lstat()
- mkdir()
- mkdirp()
- mkdirpSync()
- mkdirs()
- mkdirsSync()
- mkdirSync()
- mkdtemp()
- move()
- moveSync()
- open()
- opendir()
- outputFile()
- outputFileSync()
- outputJson()
- outputJSON()
- outputJsonSync()
- outputJSONSync()
- pathExists()
- pathExistsSync()
- read()
- readdir()
- readFile()
- readJson()
- readJSON()
- readJsonSync()
- readJSONSync()
- readlink()
- realpath()
- remove()
- removeSync()
- rename()
- rm()
- rmdir()
- stat()
- symlink()
- truncate()
- unlink()
- utimes()
- write()
- writeFile()
- writeJson()
- writeJSON()
- writeJsonSync()
- writeJSONSync()
- writev()
Interfaces
Type Aliases
Namespaces
Variables
variable createLink
const createLink: { (src: string, dest: string): Promise<void>; (src: string, dest: string, callback: (err: Error) => void): void;};
variable createLinkSync
const createLinkSync: (src: string, dest: string) => void;
variable emptydir
const emptydir: { (path: string): Promise<void>; (path: string, callback: (err: Error) => void): void;};
variable emptydirSync
const emptydirSync: (path: string) => void;
Functions
function access
access: { (path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; ( path: PathLike, mode: number, callback: (err: NodeJS.ErrnoException) => void ): void; (path: PathLike, mode?: number): Promise<void>;};
function appendFile
appendFile: { ( file: PathLike | number, data: any, options: { encoding?: BufferEncoding | string | undefined; mode?: number | string | undefined; flag?: string | undefined; }, callback: (err: NodeJS.ErrnoException) => void ): void; (file: any, data: any, callback: (err: NodeJS.ErrnoException) => void): void; (file: any, data: any, options?: any): Promise<void>;};
function chmod
chmod: { ( path: PathLike, mode: Mode, callback: (err: NodeJS.ErrnoException) => void ): void; (path: PathLike, mode: Mode): Promise<void>;};
function chown
chown: { (path: PathLike, uid: number, gid: number): Promise<void>; ( path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void ): void;};
function close
close: { (fd: number, callback: (err: NodeJS.ErrnoException) => void): void; (fd: number): Promise<void>;};
function copy
copy: { (src: string, dest: string, options?: CopyOptions): Promise<void>; (src: string, dest: string, callback: (err: Error) => void): void; ( src: string, dest: string, options: CopyOptions, callback: (err: Error) => void ): void;};
function copyFile
copyFile: { (src: string, dest: string, flags?: number): Promise<void>; (src: string, dest: string, callback: (err: Error) => void): void; (src: string, dest: string, flags: number, callback: (err: Error) => void): void;};
function copySync
copySync: (src: string, dest: string, options?: CopyOptionsSync) => void;
function createFile
createFile: { (file: string): Promise<void>; (file: string, callback: (err: Error) => void): void;};
function createFileSync
createFileSync: (file: string) => void;
function createSymlink
createSymlink: { (src: string, dest: string, type: SymlinkType): Promise<void>; ( src: string, dest: string, type: SymlinkType, callback?: (err: Error) => void ): void;};
function createSymlinkSync
createSymlinkSync: (src: string, dest: string, type: SymlinkType) => void;
function emptyDir
emptyDir: { (path: string): Promise<void>; (path: string, callback: (err: Error) => void): void;};
function emptyDirSync
emptyDirSync: (path: string) => void;
function ensureDir
ensureDir: { (path: string, options?: EnsureOptions | number): Promise<void>; (path: string, callback?: (err: Error) => void): void; ( path: string, options?: number | EnsureOptions, callback?: (err: Error) => void ): void;};
function ensureDirSync
ensureDirSync: (path: string, options?: EnsureOptions | number) => void;
function ensureFile
ensureFile: { (path: string): Promise<void>; (path: string, callback: (err: Error) => void): void;};
function ensureFileSync
ensureFileSync: (path: string) => void;
function ensureLink
ensureLink: { (src: string, dest: string): Promise<void>; (src: string, dest: string, callback: (err: Error) => void): void;};
function ensureLinkSync
ensureLinkSync: (src: string, dest: string) => void;
function ensureSymlink
ensureSymlink: { (src: string, dest: string, type?: SymlinkType): Promise<void>; ( src: string, dest: string, type: SymlinkType, callback: (err: Error) => void ): void; (src: string, dest: string, callback: (err: Error) => void): void;};
function ensureSymlinkSync
ensureSymlinkSync: (src: string, dest: string, type?: SymlinkType) => void;
function fchmod
fchmod: { (fd: number, mode: Mode, callback: (err: NodeJS.ErrnoException) => void): void; (fd: number, mode: Mode): Promise<void>;};
function fchown
fchown: { ( fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void ): void; (fd: number, uid: number, gid: number): Promise<void>;};
function fdatasync
fdatasync: { (fd: number, callback: () => void): void; (fd: number): Promise<void>;};
function fstat
fstat: { (fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void; (fd: number): Promise<Stats>;};
function fsync
fsync: { (fd: number, callback: (err: NodeJS.ErrnoException) => void): void; (fd: number): Promise<void>;};
function ftruncate
ftruncate: { (fd: number, callback: (err: NodeJS.ErrnoException) => void): void; (fd: number, len: number, callback: (err: NodeJS.ErrnoException) => void): void; (fd: number, len?: number): Promise<void>;};
function futimes
futimes: { ( fd: number, atime: number, mtime: number, callback: (err: NodeJS.ErrnoException) => void ): void; ( fd: number, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void ): void; (fd: number, atime: number, mtime: number): Promise<void>; (fd: number, atime: Date, mtime: Date): Promise<void>;};
function lchown
lchown: { ( path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void ): void; (path: PathLike, uid: number, gid: number): Promise<void>;};
function link
link: { ( existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void ): void; (existingPath: PathLike, newPath: PathLike): Promise<void>;};
function lstat
lstat: { ( path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => any ): void; (path: PathLike): Promise<Stats>;};
function mkdir
mkdir: { (path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; ( path: PathLike, options: any, callback: (err: NodeJS.ErrnoException) => void ): void; (path: PathLike, options?: any): Promise<void>;};
Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
Parameter callback
No arguments other than a possible exception are given to the completion callback.
function mkdirp
mkdirp: { (dir: string): Promise<void>; (dir: string, callback: (err: Error) => void): void;};
function mkdirpSync
mkdirpSync: (dir: string) => void;
function mkdirs
mkdirs: { (dir: string): Promise<void>; (dir: string, callback: (err: Error) => void): void;};
function mkdirsSync
mkdirsSync: (dir: string) => void;
function mkdirSync
mkdirSync: ( path: PathLike, options?: Mode | fs.MakeDirectoryOptions | null) => void;
function mkdtemp
mkdtemp: { (prefix: string): Promise<string>; ( prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void ): void;};
Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
Parameter callback
The created folder path is passed as a string to the callback's second parameter.
function move
move: { (src: string, dest: string, options?: MoveOptions): Promise<void>; (src: string, dest: string, callback: (err: Error) => void): void; ( src: string, dest: string, options: MoveOptions, callback: (err: Error) => void ): void;};
function moveSync
moveSync: (src: string, dest: string, options?: MoveOptions) => void;
function open
open: { ( path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void ): void; ( path: PathLike, flags: string | number, mode: Mode, callback: (err: NodeJS.ErrnoException, fd: number) => void ): void; (path: PathLike, flags: string | number, mode?: Mode): Promise<number>;};
function opendir
opendir: { ( path: string, cb: (err: NodeJS.ErrnoException | null, dir: fs.Dir) => void ): void; ( path: string, options: fs.OpenDirOptions, cb: (err: any, dir: fs.Dir) => void ): void; (path: string, options?: fs.OpenDirOptions): Promise<fs.Dir>;};
function outputFile
outputFile: { ( file: string, data: any, options?: WriteFileOptions | BufferEncoding | string ): Promise<void>; (file: string, data: any, callback: (err: Error) => void): void; ( file: string, data: any, options: string | WriteFileOptions, callback: (err: Error) => void ): void;};
function outputFileSync
outputFileSync: ( file: string, data: any, options?: WriteFileOptions | BufferEncoding | string) => void;
function outputJson
outputJson: { ( file: string, data: any, options?: WriteOptions | BufferEncoding | string ): Promise<void>; (file: string, data: any, options: any, callback: (err: Error) => void): void; (file: string, data: any, callback: (err: Error) => void): void;};
function outputJSON
outputJSON: { ( file: string, data: any, options?: WriteOptions | BufferEncoding | string ): Promise<void>; (file: string, data: any, options: any, callback: (err: Error) => void): void; (file: string, data: any, callback: (err: Error) => void): void;};
function outputJsonSync
outputJsonSync: ( file: string, data: any, options?: WriteOptions | BufferEncoding | string) => void;
function outputJSONSync
outputJSONSync: ( file: string, data: any, options?: WriteOptions | BufferEncoding | string) => void;
function pathExists
pathExists: { (path: string): Promise<boolean>; (path: string, callback: (err: Error, exists: boolean) => void): void;};
function pathExistsSync
pathExistsSync: (path: string) => boolean;
function read
read: { <TBuffer extends unknown>( fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback: ( err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer ) => void ): void; <TBuffer extends unknown>( fd: number, buffer: TBuffer, offset: number, length: number, position: number ): Promise<{ bytesRead: number; buffer: TBuffer }>;};
function readdir
readdir: { ( path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void ): void; ( path: PathLike, options: 'buffer' | { encoding: 'buffer'; withFileTypes?: false } ): Promise<Buffer[]>; (path: PathLike, options?: any): Promise<string[]>; (path: PathLike, options?: { encoding?: any; withFileTypes?: false }): Promise< string[] | Buffer[] >; (path: PathLike, options: { encoding?: any; withFileTypes: true }): Promise< fs.Dirent[] >;};
function readFile
readFile: { ( file: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ): void; ( file: any, encoding: any, callback: (err: NodeJS.ErrnoException, data: string) => void ): void; ( file: any, options: { flag?: string } | { encoding: any; flag?: string }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ): void; ( file: any, options: { flag?: string } | { encoding: any; flag?: string } ): Promise<string>; (file: any, encoding: any): Promise<string>; (file: any): Promise<Buffer>;};
function readJson
readJson: { (file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>; (file: string, callback: (err: Error, jsonObject: any) => void): void; ( file: string, options: any, callback: (err: Error, jsonObject: any) => void ): void;};
function readJSON
readJSON: { (file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>; (file: string, callback: (err: Error, jsonObject: any) => void): void; ( file: string, options: any, callback: (err: Error, jsonObject: any) => void ): void;};
function readJsonSync
readJsonSync: ( file: string, options?: ReadOptions | BufferEncoding | string) => any;
function readJSONSync
readJSONSync: ( file: string, options?: ReadOptions | BufferEncoding | string) => any;
function readlink
readlink: { ( path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => any ): void; (path: PathLike): Promise<string>;};
function realpath
realpath: typeof realpath;
function remove
remove: { (dir: string, callback: (err: Error) => void): void; (dir: string, callback?: (err: Error) => void): Promise<void>;};
function removeSync
removeSync: (dir: string) => void;
function rename
rename: { ( oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void ): void; (oldPath: PathLike, newPath: PathLike): Promise<void>;};
function rm
rm: ( path: PathLike, options?: { force?: boolean | undefined; maxRetries?: number | undefined; recursive?: boolean | undefined; retryDelay?: number | undefined; }) => Promise<void>;
Asynchronously removes files and directories (modeled on the standard POSIX
rm
utility).Only available in node >= v14.14.0
function rmdir
rmdir: { (path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; (path: PathLike, options?: fs.RmDirOptions): Promise<void>;};
Asynchronous rmdir - removes the directory specified in {path}
Parameter callback
No arguments other than a possible exception are given to the completion callback.
function stat
stat: { ( path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => any ): void; (path: PathLike): Promise<Stats>;};
function symlink
symlink: { ( target: PathLike, path: PathLike, type: SymlinkType | undefined, callback: (err: NodeJS.ErrnoException) => void ): void; ( target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void ): void; (target: PathLike, path: PathLike, type?: SymlinkType): Promise<void>;};
function truncate
truncate: { (path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; ( path: PathLike, len: number, callback: (err: NodeJS.ErrnoException) => void ): void; (path: PathLike, len?: number): Promise<void>;};
function unlink
unlink: { (path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; (path: PathLike): Promise<void>;};
Asynchronous unlink - deletes the file specified in {path}
Parameter callback
No arguments other than a possible exception are given to the completion callback.
function utimes
utimes: { ( path: PathLike, atime: number, mtime: number, callback: (err: NodeJS.ErrnoException) => void ): void; ( path: PathLike, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void ): void; (path: PathLike, atime: number, mtime: number): Promise<void>; (path: PathLike, atime: Date, mtime: Date): Promise<void>;};
function write
write: { <TBuffer extends unknown>( fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback: ( err: NodeJS.ErrnoException, written: number, buffer: TBuffer ) => void ): void; <TBuffer extends unknown>( fd: number, buffer: TBuffer, offset: number, length: number, callback: ( err: NodeJS.ErrnoException, written: number, buffer: TBuffer ) => void ): void; ( fd: number, data: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void ): void; ( fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void ): void; ( fd: number, data: any, offset: number, encoding: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void ): void; <TBuffer extends unknown>( fd: number, buffer: TBuffer, offset?: number, length?: number, position?: number ): Promise<{ bytesWritten: number; buffer: TBuffer }>; (fd: number, data: any, offset?: number, encoding?: any): Promise<{ bytesWritten: number; buffer: string; }>;};
function writeFile
writeFile: { ( file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void ): void; (file: any, data: any, options?: any): Promise<void>; ( file: any, data: any, options: any, callback: (err: NodeJS.ErrnoException) => void ): void;};
function writeJson
writeJson: { ( file: string, object: any, options?: WriteOptions | BufferEncoding | string ): Promise<void>; (file: string, object: any, callback: (err: Error) => void): void; (file: string, object: any, options: any, callback: (err: Error) => void): void;};
function writeJSON
writeJSON: { ( file: string, object: any, options?: WriteOptions | BufferEncoding | string ): Promise<void>; (file: string, object: any, callback: (err: Error) => void): void; (file: string, object: any, options: any, callback: (err: Error) => void): void;};
function writeJsonSync
writeJsonSync: ( file: string, object: any, options?: WriteOptions | BufferEncoding | string) => void;
function writeJSONSync
writeJSONSync: ( file: string, object: any, options?: WriteOptions | BufferEncoding | string) => void;
function writev
writev: { ( fd: number, buffers: NodeJS.ArrayBufferView[], position: number, cb: ( err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[] ) => void ): void; ( fd: number, buffers: NodeJS.ArrayBufferView[], cb: ( err: any, bytesWritten: number, buffers: NodeJS.ArrayBufferView[] ) => void ): void; ( fd: number, buffers: NodeJS.ArrayBufferView[], position?: number ): Promise<WritevResult>;};
Interfaces
interface CopyOptions
interface CopyOptions {}
property dereference
dereference?: boolean | undefined;
property errorOnExist
errorOnExist?: boolean | undefined;
property filter
filter?: CopyFilterSync | CopyFilterAsync | undefined;
property overwrite
overwrite?: boolean | undefined;
property preserveTimestamps
preserveTimestamps?: boolean | undefined;
property recursive
recursive?: boolean | undefined;
interface CopyOptionsSync
interface CopyOptionsSync extends CopyOptions {}
property filter
filter?: CopyFilterSync | undefined;
interface EnsureOptions
interface EnsureOptions {}
property mode
mode?: number | undefined;
interface MoveOptions
interface MoveOptions {}
interface PathEntryStream
interface PathEntryStream {}
method read
read: () => PathEntry | null;
interface ReadOptions
interface ReadOptions {}
interface WriteFileOptions
interface WriteFileOptions {}
interface WriteOptions
interface WriteOptions extends WriteFileOptions {}
interface WritevResult
interface WritevResult {}
property buffers
buffers: ArrayBufferView[];
property bytesWritten
bytesWritten: number;
Type Aliases
type ArrayBufferView
type ArrayBufferView = NodeJS.TypedArray | DataView;
type CopyFilterAsync
type CopyFilterAsync = (src: string, dest: string) => Promise<boolean>;
type CopyFilterSync
type CopyFilterSync = (src: string, dest: string) => boolean;
type Mode
type Mode = string | number;
type SymlinkType
type SymlinkType = 'dir' | 'file' | 'junction';
Namespaces
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/fs-extra
.
- Markdown[](https://www.jsdocs.io/package/@types/fs-extra)
- HTML<a href="https://www.jsdocs.io/package/@types/fs-extra"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 894 ms. - Missing or incorrect documentation? Open an issue for this package.