@qso-soft/shared
Version:
Shared library for QSO-soft
11 lines • 336 B
JavaScript
import { promises } from 'fs';
export const readFromFileAsync = async (inputPath) => {
try {
const result = await promises.readFile(inputPath, 'utf-8');
return JSON.parse(result);
}
catch (err) {
throw new Error(`Unable to read data from ${inputPath}`);
}
};
//# sourceMappingURL=read-file.js.map