is-writeable.js 538 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.isWriteable = isWriteable;
  6. var _fs = _interopRequireDefault(require("fs"));
  7. function _interopRequireDefault(obj) {
  8. return obj && obj.__esModule ? obj : {
  9. default: obj
  10. };
  11. }
  12. async function isWriteable(directory) {
  13. try {
  14. await _fs.default.promises.access(directory, (_fs.default.constants || _fs.default).W_OK);
  15. return true;
  16. } catch (err) {
  17. return false;
  18. }
  19. }
  20. //# sourceMappingURL=is-writeable.js.map