|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
347 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | 'use strict';
|
|---|
| 2 | const fs = require('fs');
|
|---|
| 3 | const {promisify} = require('util');
|
|---|
| 4 |
|
|---|
| 5 | const pAccess = promisify(fs.access);
|
|---|
| 6 |
|
|---|
| 7 | module.exports = async path => {
|
|---|
| 8 | try {
|
|---|
| 9 | await pAccess(path);
|
|---|
| 10 | return true;
|
|---|
| 11 | } catch (_) {
|
|---|
| 12 | return false;
|
|---|
| 13 | }
|
|---|
| 14 | };
|
|---|
| 15 |
|
|---|
| 16 | module.exports.sync = path => {
|
|---|
| 17 | try {
|
|---|
| 18 | fs.accessSync(path);
|
|---|
| 19 | return true;
|
|---|
| 20 | } catch (_) {
|
|---|
| 21 | return false;
|
|---|
| 22 | }
|
|---|
| 23 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.