Skip to content

Commit

Permalink
Updated readme with export descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
matutter committed Jul 15, 2016
1 parent 457efb2 commit eba2881
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
[![Build Status](https://travis-ci.org/matutter/profs.svg?branch=master)](https://travis-ci.org/matutter/profs)
[![Coverage Status](https://coveralls.io/repos/github/matutter/profs/badge.svg?branch=master)](https://coveralls.io/github/matutter/profs?branch=master)

Coverage for async fs api
```json
{
"api_coverage": "%28",
"api_isAsync": 46,
"covered": [
"F_OK",
"R_OK",
"W_OK",
"X_OK",
"access",
"mkdir",
"unlink",
"rmdir",
"open",
"close",
"stat",
"fstat",
"readdir"
],
"value_add": [
"fs",
"mkdirp",
"touch",
"readdirStat",
"walk",
"removerf"
]
}
Profs currently wraps 28% of the existing fs module and adds an additional 6 methods.


Extra methods include.
## 1 Unique to profs
The fs module is exported for utility.
```javascript
var pro = require('./profs.js')
pro.fs.writeFileSync('file', "I'm a normal fs function")
pro.readFile('file', 'utf8')
.then(console.log)
.then(() => pro.unlink('file'))
.catch(console.error)
```
## 1.0 fs.stat
The ```fs.stat``` object has a ```path``` property containing the fully-qualified path to the file; this makes unbound chaining more simple.
## 1.1 mkdirp
Acts like the linux command "mkdir -p" and creates the full path a directory.
## 1.2 touch
Acts like the linux command "touch" and create an empty file.
## 1.3 readdirStat
Creates an array of fs.stats for each file in a directory.
## 1.4 walk
Walks entire directory structure creating ```{files:[], directories:[]}``` object of either fs.stats or fully-qualified paths.
## 1.5 removerf
Remove a folder and all of it's contents.

0 comments on commit eba2881

Please sign in to comment.