Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrisdothtml/pfs
A tiny promise wrapper around fs
https://github.com/chrisdothtml/pfs
filesystem nodejs promise wrapper
Last synced: about 1 month ago
JSON representation
A tiny promise wrapper around fs
- Host: GitHub
- URL: https://github.com/chrisdothtml/pfs
- Owner: chrisdothtml
- License: mit
- Created: 2018-03-06T16:16:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-17T16:05:19.000Z (over 2 years ago)
- Last Synced: 2024-09-14T09:26:50.806Z (2 months ago)
- Topics: filesystem, nodejs, promise, wrapper
- Language: JavaScript
- Homepage: https://npm.im/pfs
- Size: 38.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# pfs
![node version](https://img.shields.io/badge/node-%3E%3D6-brightgreen.svg)
[![travis-ci build status](https://api.travis-ci.org/chrisdothtml/pfs.svg?branch=master)](https://travis-ci.org/chrisdothtml/pfs/branches)
[![StandardJS](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)> A tiny promise wrapper around [fs](https://nodejs.org/dist/latest-v9.x/docs/api/fs.html)
## Install
```bash
$ yarn add pfs# or npm
$ npm install --save pfs
```## Use
Exactly how you would use `fs`. This is a drop-in replacement that converts any callback-based functions to promises
```javascript
const fs = require('pfs')// now uses promise
fs.readFile('my-file.txt', 'utf-8')
.then(...)
.catch(...)// still works the same
fs.readFileSync('my-file.txt', 'utf-8')// properties are also unchanged
fs.constants.R_OK
```## [Changelog](https://github.com/chrisdothtml/pfs/releases)
## License
[MIT](LICENSE)