npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@react-lib-tech/react-code-scanner

v1.0.6

Published

Static code scanner with React UI components for viewing scan results

Readme

📦 React Code Scanner

A simple static code analysis tool built with Babel parser that scans your React (JS/TS/JSX/TSX) project for common security risks and code smells like:

  • 🚨 eval() usage
  • 🚨 Function constructor usage
  • ⚠️ console.log statements

It provides developer-friendly results in a React UI table.


✨ Features

  • Detects dangerous functions (eval, Function constructor).
  • Detects console.log and similar debug statements.
  • Parses modern JavaScript, TypeScript, JSX, TSX.
  • Displays results in a clean React Tailwind UI table.

📦 Installation (for users)

Install the package from npm:

npm install @react-lib-tech/react-code-scanner

or with Yarn:

yarn add @react-lib-tech/react-code-scanner

🚀 Usage Examples

1. Run Code Scan Programmatically (Node.js)

If you want to scan your project folder for issues:

import { ReactCodeScanner } from "@react-lib-tech/react-code-scanner";

const results = ReactCodeScanner("./src");

console.log(results);
/*
[
  {
    type: "Security",
    message: "Avoid using eval()",
    suggestion: "Use JSON.parse() or safer parsing methods",
    file: "src/utils/unsafe.js",
    loc: { start: { line: 12, column: 4 } }
  }
]
*/

2. Show Results in React Component

If you want to render scan results inside your app:

import React from "react";
import { ReactCodeScannerResults } from "@react-lib-tech/react-code-scanner";

function App() {
  return (
    <div>
      <h1>🔎 My Project Scan</h1>
      <ReactCodeScannerResults root="./src" />
    </div>
  );
}

export default App;

This will render a styled table with all detected issues.


📊 Example UI

| File | Line | Type | Message | Suggestion | |---------------------|------|-----------|------------------|--------------------------------------| | src/App.js | 10 | Security | Avoid using eval | Use JSON.parse() or safer parsing | | src/utils/log.tsx | 45 | CodeSmell | console.log found | Remove in production or use a logger |


🛠️ Development (for contributors)

Install dependencies:

npm install

Run build:

npm run build

Run scanner test:

node scanner.js

📦 React Code Scanner

npm version license Node.js CI

A lightweight SonarQube-like static analysis tool for React (JS/TS/JSX/TSX) projects.

It scans your code for:

  • 🚨 Security issues (eval, Function, secrets, unsafe process.env)
  • ⚠️ Code smells (console.log, var, empty catch)
  • 📊 Complexity problems (cyclomatic complexity, long functions)
  • 📂 Duplicate code (function body hashing)

It generates developer-friendly reports in JSON, HTML, SARIF and can display them in a React Tailwind UI table.


✨ Features

  • Detects dangerous functions (eval, Function, alert, prompt).
  • Detects console.log and debug statements.
  • Detects hardcoded secrets (AWS keys, JWT, API tokens).
  • Detects empty catch blocks & unsafe process.env usage.
  • Calculates cyclomatic complexity & detects long functions.
  • Detects duplicate functions/code blocks.
  • Generates reports:
    • scan-report.json → CI/CD & automation
    • scan-report.html → SonarQube-style dashboard
    • scan-report.sarif → GitHub Code Scanning
  • Configurable Quality Gate for CI/CD (fail builds if thresholds exceeded).
  • Keeps history snapshots in .scan-history/ for trend analysis.
  • Exposes a React Component to show results in a styled table.

📦 Installation

Install the package from npm:

npm install @react-lib-tech/react-code-scanner --save-dev


## 📜 License

MIT © 2025 Abhishek Kumar Singh

---