mirror of
https://github.com/unraid/api.git
synced 2026-05-05 14:41:54 -05:00
10 lines
199 B
TypeScript
10 lines
199 B
TypeScript
import { readFileSync } from 'fs';
|
|
|
|
export const attemptReadFileSync = (path: string, fallback: any = undefined) => {
|
|
try {
|
|
return readFileSync(path, 'utf-8');
|
|
} catch {
|
|
return fallback;
|
|
}
|
|
};
|