1.1.0 • Published 6 years ago
@ianwalter/fs v1.1.0
@ianwalter/fs
A Proxy over Node's fs module to make it Promise-based and add events
Features
- Use Promises and/or async/await with fs methods, e.g.:
const text = await fs.readFile('./top-secret.txt')
- Subscribe to filesystem events from anywhere, e.g.:
fs.sub('./top-secret.txt', action => { console.log(action.method, action.args) })
- Control async filesystem events through subscriptions, e.g.:
fs.sub('./top-secret.txt', async action => { if (action.method === 'writeFile') { throw new Error('How dare you!? You have no write!') } })
Installation
yarn add @ianwalter/fs
License
Apache 2.0 with Commons Clause - See LICENSE
Created by Ian Walter