11 lines
249 B
JavaScript
11 lines
249 B
JavaScript
|
const { readFile } = require('fs/promises');
|
||
|
const { join } = require('path');
|
||
|
|
||
|
module.exports = async (dir, file) => {
|
||
|
try {
|
||
|
const data = await readFile(join(process.cwd(), dir, file));
|
||
|
return data;
|
||
|
} catch (e) {
|
||
|
return null;
|
||
|
}
|
||
|
};
|