Skip to content

Commit

Permalink
Add usage and examples in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bertyhell authored and isaacs committed Sep 18, 2018
1 parent 3b1a53e commit fa300c4
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
Like `chmod -R`.
## Description
Has the same effect as the command line command: `chmod -R`.

Takes the same arguments as `fs.chmod()`
## Install

```
npm i --save chmodr
```

## Usage

Takes the same arguments as [`fs.chmod()`](https://nodejs.org/api/fs.html#fs_fs_chmod_path_mode_callback)

chmodr(path, mode, callback)
* path `<string>` | `<Buffer>` | `<URL>`
* mode `<integer>`
* callback `<Function>`
* err `<Error>`

## Example
```javascript
var chmodr = require('chmodr');

chmodr('/var/www/my/test/folder', 0o777, (err) => {
if (err) {
console.log('Failed to execute chmod', err);
} else {
console.log('Success');
}
});
```

0 comments on commit fa300c4

Please sign in to comment.