MCPcopy Index your code
hub / github.com/antfu/fs-spy

github.com/antfu/fs-spy @v0.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.2 ↗ · + Follow
12 symbols 29 edges 3 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

image

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

Extension points exported contracts — how you extend this code

TreeNode (Interface)
(no doc)
src/display.ts

Core symbols most depended-on inside this repo

displayTree
called by 2
src/display.ts
renderTreeNodes
called by 2
src/display.ts
registerSpy
called by 1
src/index.ts
_onEvent
called by 1
src/index.ts
writeLog
called by 1
src/index.ts
printCountTree
called by 1
src/index.ts
createNode
called by 1
src/display.ts
pathListToTree
called by 1
src/display.ts

Shape

Function 11
Interface 1

Languages

TypeScript100%

Modules by API surface

src/display.ts7 symbols
src/index.ts5 symbols

For agents

$ claude mcp add fs-spy \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact