can-write-to-dir
v1.1.1
Published
Returns true if the current process has permission to write to the specified directory
Downloads
309,788
Maintainers
Readme
can-write-to-dir
Returns true if the current process has permission to write to the specified directory
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.