Skip to content

Commit

Permalink
Task: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nick spragg committed Feb 1, 2017
1 parent 6b7d869 commit 8eafbf8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ npm install --save file-js
const File = require('file-js');

const file = File.create('myFile');
file.getFiles()
file.getList()
then((files) => {
files.each(console.log);
});
Expand All @@ -71,15 +71,15 @@ if (pathname.isFile()) {
Synchronously list files:
```js
const dir = File.create('myDirectory');
const files = dir.getFilesSync()
const files = dir.getListSync()

console.log(files.forEach(console.log));
```

Asynchronously list files:
```js
const dir = File.create('myDirectory');
dir.getFiles().each(console.log);
dir.getList().each(console.log);
```

#### File locking
Expand Down Expand Up @@ -154,7 +154,7 @@ Get list of files for a directory:

```js
const dir = File.create('myDir');
dir.getFiles((err, files) => {
dir.getList((err, files) => {
if (err) return console.error(err);

console.log(files);
Expand All @@ -174,16 +174,16 @@ Returns a File instance.

## Instance methods

### `.getFiles() -> Promise`
### `.getList() -> Promise`

##### Parameters
* None

##### Returns
* If the Promise fulfils, the fulfilment value is an array of files in the directory or null if it's a file

### `.getFilesSync() -> Promise`
Synchronous version of `.getFiles()`
### `.getListSync() -> Promise`
Synchronous version of `.getList()`

### `.isDirectory() -> Promise`

Expand Down

0 comments on commit 8eafbf8

Please sign in to comment.