21 lines
226 B
JavaScript
21 lines
226 B
JavaScript
|
const fs = require('fs').promises;
|
||
|
|
||
|
|
||
|
class AsyncFs
|
||
|
{
|
||
|
async exists(path)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
await fs.access(path);
|
||
|
return true;
|
||
|
}
|
||
|
catch
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
module.exports = AsyncFs;
|