@capgo/cli
Version:
A CLI to upload to capgo servers
27 lines (26 loc) • 1.01 kB
TypeScript
interface WriteOptions {
mode?: number;
encoding?: BufferEncoding;
}
/**
* Create (or reuse) a directory and enforce safe permissions.
*/
export declare function ensureSecureDirectory(path: string, mode: number): Promise<void>;
/**
* Append content to a file without following symbolic links.
*/
export declare function appendToSafeFile(filePath: string, content: string, mode?: number): Promise<void>;
/**
* Write content atomically by writing a temp file and renaming.
*/
export declare function writeFileAtomic(filePath: string, content: string, options?: WriteOptions): Promise<void>;
/**
* Read file content while rejecting symbolic-link targets.
*/
export declare function readSafeFile(filePath: string): Promise<string>;
/**
* Read file BYTES while rejecting symbolic-link targets (binary-safe twin of
* readSafeFile — for credential files like keystores / .p12 / .p8 that are not utf-8).
*/
export declare function readSafeFileBytes(filePath: string): Promise<Buffer>;
export {};