-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated readme with export descriptions
- Loading branch information
Showing
1 changed file
with
25 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |