A small, strange building block. https://conduitry.dev/defiler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
defiler/dist/index.d.ts

33 lines
606 B

import * as fs from 'fs';
export class Defiler {
paths: Set<string>;
files: Map<string, File>;
constructor(...args: any[]);
exec(): Promise<void>;
get(path: string): Promise<File>;
get(paths: string[]): Promise<File[]>;
get(filter: Filter): Promise<File[]>;
add(file: FileData): Promise<void>;
resolve(path: string): string;
}
export class File {
stats: fs.Stats;
path: string;
dir: string;
filename: string;
ext: string;
enc: BufferEncoding;
bytes: Buffer;
text: string;
}
interface Filter {
(path: string): boolean;
}
interface FileData {
path: string;
[propName: string]: any;
}