An open API service indexing awesome lists of open source software.

https://github.com/wahengchang/filehelper

it is a npm package that provides fs function
https://github.com/wahengchang/filehelper

filesystem nodejs tool tutorial utils write

Last synced: 29 days ago
JSON representation

it is a npm package that provides fs function

Awesome Lists containing this project

README

          

# filehelper

it is a npm package that provides fs function, with file existed check before file write.

[![NPM](https://nodei.co/npm/filehelper.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/filehelper)

## Install

```
$ npm install --save filehelper
```

## Usage

#### Writing a file:

- 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');})

```

#### Read a file:

```js
var filehelper = require("filehelper")

filehelper.read('./data.json')
.then( res=> {console.log(res)})

```

## License

MIT © [Waheng Chang](http://github.com/wahengchang)