0.0.2 • Published 2 years ago

fs-spy v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

fs-spy

NPM version

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

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago