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 🙏

© 2026 – Pkg Stats / Ryan Hefner

refactorcode

v1.0.0

Published

A console application to reduce bugs, improve performance and improve readability of your code.

Readme

RefactorCode

A console application to reduce bugs, improve performance and improve readability of your code.

https://github.com/user-attachments/assets/9ca694a3-da23-4ae3-b476-1c071e675a66

Features

  • Checks for any bugs and corrects them (out of bounds, performance issues, logical bugs).
  • Removes commented out and unreachable code.
  • Adds comments to explain existing code.
  • Splits very large functions into smaller functions for better modularity.

Usage

refactorcode ./yourfile

By the refactored code is displayed in the console. To specify an output file, use -o. See Options

Setup Instructions

Clone the repo

git clone https://github.com/brokoli777/RefactorCode.git

Install node libraries

pnpm install

OR

npm install

Get an API Key from here: https://ai.google.dev/aistudio Screenshot 2024-09-10 at 3 06 46 PM

Configuration Setup

To configure your application, there are 2 options, creating a .env file or a .toml file:

Option 1: Create a .env file in your project root directory, and add the API key like this:

API_KEY=YOURAPIKEYHERE

Option 2: Create a .toml file named .refactorcode.toml in your home directory, and add your API key and/or preferences:

  1. Create the TOML File:
    Open your terminal and run the following command to create a new TOML file in your home directory:

    touch ~/.refactorcode.toml
  2. Copy the Sample Configuration:
    Next, copy the sample configuration from .refactorcode.toml.example into your newly created .refactorcode.toml file:

    cp .refactorcode.toml.example ~/.refactorcode.toml
  3. Edit the Configuration:
    Open the .refactorcode.toml file in your preferred text editor, and add your API key value, and any other preferences (e.g. MODEL) you need.

Link the application


npm link

Run the application


refactorcode examples/test.py

Options

-m or --model: Allows to specify the model

Choices:

  • 1.5f (gemini-1.5-flash) (default)
  • 1.5p (gemini-1.5-pro)

refactorcode examples/test.py -m 1.5p

-o or --output- Allows to set the output file

-t or --token-usage: Allows get information on the tokens used

-s or --stream Streams the response as it is received


refactorcode examples/test.py -o hello.py