npm.io
2.0.0 • Published 5 months ago

can-write-to-dir

Licence
MIT
Version
2.0.0
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
104

can-write-to-dir

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

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

Keywords