jsonspy
v1.0.6
Published
Find React components using a given JSON structure
Maintainers
Readme
jsonspy
Find React components using a given JSON structure.
jsonspy is a CLI package that scans your React project to identify components whose props match a specified JSON structure. It works with .tsx, .ts, .jsx, and .js files.
Installation
You can use npx (no installation needed) or install globally / locally:
# Using npx (no installation needed)
npx jsonspy ./src '{"isChecked": true}'
for windows
npx jsonspy ./src '{\"isChecked\": true}'
# Install globally
npm install -g jsonspy
jsonspy ./src '{"isChecked": true}'
# Install locally in your project
npm install jsonspy --save-devUsage
CLI
You can also use jsonspy directly from the command line:
npx jsonspy <directory> '<JSON>'→ path to the project root or src folder
→ JSON structure to search for
Example:
npx jsonspy ./src '{"isChecked": true}'Output:
[ "ParentComponent", "DemoComponent" ]
Features
Detect JSX props matching a JSON structure
Works with React components in .tsx, .ts, .jsx, and .js files
Simple CLI interface
Fast and lightweight
