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 🙏

© 2024 – Pkg Stats / Ryan Hefner

exporttogpt

v1.0.2

Published

"Export to GPT" is a utility tool designed to streamline the process of using ChatGPT for development and debugging. It simplifies the task of identifying and copying relevant project files and their directory structures, making it easy to paste them into

Downloads

9

Readme

ExportToGPT.js

ExportToGPT.js is a utility designed to streamline the process of using ChatGPT for programming, development, and debugging. It simplifies the task of identifying and copying relevant project files and their directory structures, making it easy to paste them into ChatGPT (and other LLM based) prompts.

Great for software development using ChatGPT as well as using ChatGPT to debug!

Simply:

  1. exporttogpt "./project" "/desired/file"
  2. Copy the generated SYSTEM prompt.
  3. Paste the SYSTEM prompt into your favorite LLM.
  4. Enter your development/debugging related instructions in the USER prompt.
  5. ???
  6. Profit!

Key Features

  • Framework Detection: Automatically detects popular JavaScript frameworks (Express.js, React, Vue.js, Angular, Koa.js, NestJS) and includes relevant files.
  • Dependency Resolution: Analyzes require, import, and include statements to identify and include dependent files.
  • Excludes Unrelated Files: Filters out non-code resources such as images and stylesheets, focusing on code files and templates.
  • Enhanced Context for ChatGPT: Prints the specified input file both at the start and end if there are more than 5 total files, ensuring better context retention for ChatGPT.

Installation

To install ExportToGPT.js globally, run:

npm install -g exporttogpt

Usage

To use the tool, run:

exporttogpt <project_directory> <filename>

Example Input

Current Directory:

exporttogpt "./" "src/index.js"

Absolute Directory:

exporttogpt "/path/to/project" "src/index.js"

Example Output

SYSTEM:
You are a Senior Node.js Software Engineer. Please use the following directory structure and provided project files to respond about the 'src/index.js' file.

Directory Structure:
{
  "src": {
    "index.js": "file",
     ...
    },
    ...
  },
  ...
}

File: /path/to/project/src/index.js
----------------------
...file contents...
----------------------

File: /path/to/project/src/components/App.js
----------------------
...file contents...
----------------------
...

If there are more than 5 files, the specified input file is printed at both the start and the end to enhance context retention for LLM based prompts like ChatGPT.

Troubleshooting

Common Issues

  1. File Not Found:
    • Ensure the specified file path is correct and exists within the project directory.
  2. Framework Not Detected:
    • Double-check if the package.json contains the relevant dependencies for the supported frameworks.

How It Enhances ChatGPT Usage

ExportToGPT.js makes it easier to provide ChatGPT with the context it needs to assist in development and debugging. By structuring and filtering relevant files, you can ensure that ChatGPT has the necessary information to provide accurate and helpful responses.

Enhanced Context Management

With its ability to print the specified input file at both the start and the end of the output when there are more than 5 files, ExportToGPT.js ensures that important context is retained, improving the quality of assistance provided by ChatGPT.

Supports Various Frameworks

The tool supports a range of popular JavaScript frameworks, making it versatile for many types of projects:

  • Express.js: Includes routes, controllers, models, and views.
  • React: Includes components, hooks, Redux files, and excludes non-relevant resources like CSS.
  • Vue.js: Includes components, store modules, mixins, and templates.
  • Angular: Includes components, services, stores, and templates.

Contributing

Contributions are welcome! If you have any issues or feature requests, feel free to open an issue or submit a pull request on our GitHub repository.

Steps to Contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Implement your changes.
  4. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Disclaimer

I'm not affiliated with OpenAI or ChatGPT.