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

stupid-code

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stupid-code

Stupid

latest
Source
npmnpm
Version
11.2.1
Version published
Weekly downloads
0
-100%
Maintainers
0
Weekly downloads
 
Created
Source

Stupid Code

stupid-code is a tool that helps developers scan and identify code in their projects that they consider to be poorly written or "stupid."

Installation

You can install stupid-code globally or as a development dependency in your project.

Global Installation

npm install -g stupid-code

Local Installation

npm install --save-dev stupid-code

Usage

You can run stupid-code using the command line interface.

Command Line Options

  • -p, --path <name>: Specify the directory path to scan.
  • -c, --code <code>: Specify the code snippet to search for.
  • -s, --sourceType <type>: Specify the JavaScript source type. Defaults to 'module'.
  • -o, --output <name>: Specify the output file path. Defaults to 'output.html'.
  • -i, --ignore <name>: Specify the ignore pattern. Defaults to 'node_modules/**'.

Example Commands

  • Scan a directory for "stupid" code:
   stupidcode -p ./src -c "console.log('debug')"

This command scans the ./src directory for occurrences of console.log('debug').

  • Specify the JavaScript source type:
   stupidcode -p ./src -c "var x = 1;" -s script

This command scans the ./src directory for the code var x = 1; in files considered as JavaScript scripts.

  • Output results to a custom file:
   stupidcode -p ./src -c "debugger;" -o results.html

This command scans the ./src directory for occurrences of debugger; and writes the output to results.html.

  • Ignore specific patterns:
   stupidcode -p ./src -c "eval(" -i "test/**"

This command scans the ./src directory for occurrences of eval( while ignoring files in the test directory.

Repository

You can find the source code and contribute to this project at GitHub - opopeieie/stupid-code.

Keywords

stupid

FAQs

Package last updated on 09 Aug 2024

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