包详细信息

can-write-to-dir

zkochan389.9kMIT1.1.1

Returns true if the current process has permission to write to the specified directory

access, permission, directory, folder

自述文件

can-write-to-dir

Returns true if the current process has permission to write to the specified directory

!--@shields('npm')--

npm version !--/@--

Installation

<npm|yarn|pnpm> add can-write-to-dir

Usage

const canWriteToDir = require('can-write-to-dir')

canWriteToDir.sync('C:\\')
//> false

API

canWriteToDir.sync(dir): Boolean

Returns true if fs.writeFileSync is able to create a file.

canWriteToDir(dir): Promise<Boolean>

Returns true if fs.writeFile is able to create a file.

License

MIT © Zoltan Kochan

更新日志

can-write-to-dir

1.1.1

Patch Changes

  • 33a7d64: canWriteToDir.sync() should not fail on EROFS error.

1.1.0

Minor Changes

  • bba9985: graceful-fs and mz removed from dependencies.

1.0.0

Major Changes

  • 48d36f2: Project created.