0.0.2 • Published 2 years ago
fs-spy v0.0.2
fs-spy
Monitoring fs accessing for Node process
Install
npm i -D fs-spy
Usage
node -r fs-spy my-module.js
For wrapped CLIs:
# NODE_OPTIONS=--require=fs-spy <command>
NODE_OPTIONS=--require=fs-spy rollup -c
Debugging
You can use fs-spy
to debug why certain file has be accessed by using the hook. For example
import spy from 'fs-spy'
spy.onFileEvent((event, filepath) => {
if (filepath.endsWith('.json'))
throw new Error('See the stack trace')
})
Sponsors
License
MIT License © 2022 Anthony Fu