@kayahr/ed-journal
Version:
Typescript library to read/watch the player journal of Frontier's game Elite Dangerous
31 lines • 751 B
JavaScript
/*
* Copyright (C) 2022 Klaus Reimer <k@ailis.de>
* See LICENSE.md for licensing information.
*/
import { constants } from "node:fs";
import { access, stat } from "node:fs/promises";
/**
* Checks if given path is readable.
*
* @param path - The path to check.
* @returns True if path is readable, false if not.
*/
export async function isPathReadable(path) {
try {
await access(path, constants.R_OK);
return true;
}
catch {
return false;
}
}
/**
* Checks if given path is a directory.
*
* @param path - The path to check.
* @returns True if path is a directory, false if not.
*/
export async function isDirectory(path) {
return (await stat(path)).isDirectory();
}
//# sourceMappingURL=fs.js.map