New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-file-analyzer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-file-analyzer

A comprehensive NPM package for analyzing React and Next.js files, including dependency graphs, component insights, and project structure visualization.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

react-file-analyzer

A powerful NPM package for analyzing React and Next.js projects. It provides tools for file insights, dependency graphs, directory structures, and more. Can be used as a CLI or via an HTTP server.

Installation

npm install react-file-analyzer

Usage

CLI Examples

  • Comprehensive file analysis:

    react-file-analyzer --analyze-comprehensive path/to/file.tsx --json
    
  • Dependency analysis:

    react-file-analyzer --analyze-deps --diagram-type flowchart
    
  • Read file contents:

    react-file-analyzer --read-files file1.tsx,file2.tsx --json
    
  • Directory tree:

    react-file-analyzer --dir-tree . --depth 3 --json
    
  • Start server:

    react-file-analyzer --serve --port 3000 --token mysecret
    

Server Endpoints

  • POST /analyze-comprehensive { "filePath": "path/to/file.tsx" } - Comprehensive insights.
  • POST /analyze-deps { "includePatterns": [...], ... } - Dependency graph.
  • POST /read-files { "files": ["file1.tsx", "file2.tsx"] } - File contents.
  • GET /dir-structure?dir=. - Directory structure.
  • GET /dir-tree?dir=.&depth=3 - Directory tree.
  • POST /analyze-simple { "filePath": "path/to/file.tsx" } - Simple insights.
  • POST /clean { "dir": "path/to/dir" } - Clean directory.

All endpoints require Bearer token if set.

Features

  • Babel-powered AST analysis for components, hooks, props, state, functions.
  • Dependency graph with circular detection and Mermaid diagrams.
  • Secure server with path traversal protection.
  • Directory traversal and cleaning utilities.

For more details, see the source code or run --help.

Keywords

react

FAQs

Package last updated on 19 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts