Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cnlon/promisified-fs
A promisified version of fs(File System) in Node.js.
https://github.com/cnlon/promisified-fs
fs promise
Last synced: 7 days ago
JSON representation
A promisified version of fs(File System) in Node.js.
- Host: GitHub
- URL: https://github.com/cnlon/promisified-fs
- Owner: cnlon
- License: mit
- Created: 2017-06-06T08:35:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-05T05:00:13.000Z (about 7 years ago)
- Last Synced: 2024-10-27T14:18:25.426Z (19 days ago)
- Topics: fs, promise
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# promisified-fs
[![node version](https://img.shields.io/badge/node-%3E%3Dv0.12-brightgreen.svg)](https://travis-ci.org/cnlon/promisified-fs)
[![npm version](https://img.shields.io/npm/v/promisified-fs.svg?colorB=brightgreen)](https://www.npmjs.com/package/promisified-fs)
[![build status](https://img.shields.io/travis/cnlon/promisified-fs/master.svg)](https://travis-ci.org/cnlon/promisified-fs)
[![code style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)A promisified version of `fs`.
Many `fs` methods are converted into promises.
Any properties that aren't asynchronous will simply be proxied.## Installation & Usage
```bash
npm install promisified-fs
``````javascript
const fs = require('promisified-fs')fs.access('filename.txt', fs.constants.W_OK)
.then(function () {
console.log('Can write!')
})
.catch(function (error) {
console.log('No access!')
})
```With ES2017 `async/await`:
```javascript
const fs = require('promisified-fs')async function doSomething () {
const data = await fs.readFile('filename.txt')
// do something
}
```## License
[MIT](https://github.com/cnlon/promisified-fs/blob/master/LICENSE)