1.1.1 • Published 3 years ago

can-write-to-dir v1.1.1

Weekly downloads
3,473
License
MIT
Repository
github
Last release
3 years ago

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