A Proxy over Node's fs module to make it Promise-based and add events
- Use Promises and/or async/await with async 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.name, action.args) })
- Control async filesystem events through subscriptions, e.g.:
fs.sub('./top-secret.txt', async action => { if (action.name === 'writeFile') { throw new Error('How dare you!? You have no write!') } })
yarn add @ianwalter/fs
Apache 2.0 with Commons Clause - See LICENSE
Created by Ian Walter