1.0.0 • Published 4 years ago

path-mode v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

path-mode Travis CI Build Status

Check the permissions for a file path.

NPM Badge

Install

npm install path-mode

Usage

const {isWritable} = require("path-mode");

(async () => {
	console.log(await isWritable('package.json'));
	//=> true
})();

API

isReadable(path)

Check if a path is readable.

path

Type: string

The path to check.

Returns a Promise<boolean>.

isWritable(path)

Check if a path is writable.

Returns a Promise<boolean>.

isReadableSync(path)

Synchronously check if a path is readable.

Returns a boolean.

isWritableSync(path)

Synchronously check if a path is writable.

Returns a boolean.