filehelper
Version:
File system helper, tool, with file existed check before file write.
47 lines (25 loc) • 799 B
Markdown
it is a npm package that provides fs function, with file existed check before file write.
[](https://www.npmjs.com/package/filehelper)
```
$ npm install --save filehelper
```
- replace the old one, while the file is existed
- create new one, while the file is not existed
```js
var filehelper = require("filehelper")
var str = ' I love Peter 3';
filehelper.write('./data.json', str)
.then( res=> {console.log('file is created');})
```
```js
var filehelper = require("filehelper")
filehelper.read('./data.json')
.then( res=> {console.log(res)})
```
MIT © [Waheng Chang](http://github.com/wahengchang)