1.2.10 • Published 1 year ago
virtual-file-system v1.2.10
virtual-file-system
npm package for virtual file systems (directories, files)
npm i virtual-file-system
Exports classes File
and Directory
export { File, Directory };
declare class File {
name: string;
data: string;
metadata: any;
location: string;
constructor(
name: string,
data: string,
options?: {
location?: string;
}
);
write(location?: string): void;
static read(path: string): File | null;
getExtension(): string;
getNameWithoutExtension(): string;
getPath(): string;
toString(): string;
}
declare class Directory {
name: string;
location: string;
files: File[];
directories: Directory[];
constructor(name: string, location?: string);
/**
* Overwrites existing folder.
* @param {string} location
*/
write(location?: string): void;
writeContents(location?: string): void;
static read(path: string, exclude?: (RegExp | string)[]): Directory | null;
getDirectories(name: string): Directory[];
getDirectory(name: string): Directory | null;
getFiles(name: RegExp | string): File[];
getFile(name: RegExp | string): File | null;
removeFile(file: File): void;
apply(func: (f: File) => void): void;
filter(func: (f: File) => boolean): void;
toString(): string;
}
1.2.10
1 year ago
1.2.8
2 years ago
1.2.7
2 years ago
1.2.6
2 years ago
1.2.5
2 years ago
1.2.4
2 years ago
1.2.3
2 years ago
1.2.9
2 years ago
1.2.0
2 years ago
1.2.2
2 years ago
1.2.1
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago