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

@kudoai/chatgpt.js

v2.6.9

Published

Client-side JavaScript library for ChatGPT

Downloads

308

Readme

🤖 A powerful client-side JavaScript library for ChatGPT

💡 About

chatgpt.js is a powerful JavaScript library that allows for super easy interaction w/ the ChatGPT DOM.

  • Feature-rich
  • Object-oriented
  • Easy-to-use
  • Lightweight (yet optimally performant)

⚡ Importing the library

Note To always import the latest version (NOT recommended in production!) replace the versioned jsDelivr URL with: https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js/chatgpt.min.js

ES6:

(async () => {
    await import('https://cdn.jsdelivr.net/npm/@kudoai/[email protected]/dist/chatgpt.min.js');
    // Your code here...
})();

ES5:

var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/[email protected]/dist/chatgpt.min.js');
xhr.onload = function () {
    if (xhr.status === 200) {
        var chatgptJS = document.createElement('script');
        chatgptJS.textContent = xhr.responseText;
        document.head.append(chatgptJS);
        yourCode(); // runs your code
    }
};
xhr.send();

function yourCode() {
    // Your code here...
}

Greasemonkey:

Note To use a starter template: kudoai/chatgpt.js-greasemonkey-starter

...
// @require https://cdn.jsdelivr.net/npm/@kudoai/[email protected]/dist/chatgpt.min.js
// ==/UserScript==

// Your code here...

Chrome:

Note To use a starter template: kudoai/chatgpt.js-chrome-starter

Since Google does not allow remote code, importing chatgpt.js locally is required:

  1. Save https://raw.githubusercontent.com/KudoAI/chatgpt.js/main/chatgpt.js to a subdirectory (lib in this example)

  2. Add ES6 export statement to end of lib/chatgpt.js

...
export { chatgpt }
  1. In project's (V3) manifest.json, add lib/chatgpt.js as a web accessible resource
    "web_accessible_resources": [{
        "matches": ["<all_urls>"],
        "resources": ["lib/chatgpt.js"]
    }],
  1. In scripts that need chatgpt.js (foreground/background alike), import it like so:
(async () => {
    const { chatgpt } = await import(chrome.runtime.getURL('lib/chatgpt.js'));
    // Your code here...
})();

💾 Downloading via npm:

To download chatgpt.js for local customization, run the following command in your project's root:

npm install @kudoai/chatgpt.js

After installation, navigate to node_modules/@kudoai/chatgpt.js to find the library source (minified version in dist/).

💻 Usage

chatgpt.js was written w/ ultra flexibility in mind.

For example:

chatgpt.getLastResponse();
chatgpt.getLastReply();
chatgpt.response.getLast();
chatgpt.get('reply', 'last');

Each call equally fetches the last response. If you think it works, it probably will... so just type it!

If it didn't, check out the extended userguide, or simply submit an issue or PR and it will be integrated, ezpz!

🤖 Made with chatgpt.js

https://github.com/KudoAI/chatgpt.js/assets/10906554/f53c740f-d5e0-49b6-ae02-3b3140b0f8a4

Autoclear ChatGPT History

Auto-clear your ChatGPT query history for maximum privacy. Install / Readme / Discuss

BraveGPT

Display ChatGPT answers in Brave Search sidebar (powered by GPT-4!) Install / Readme / Discuss

ChatGPT Auto-Continue ⏩

Automatically continue generating multiple ChatGPT responses. Install / Readme / Discuss

ChatGPT Auto Refresh ↻

Keeps ChatGPT sessions fresh to eliminate network errors + Cloudflare checks. Install / Readme / Discuss

DuckDuckGPT

Display ChatGPT answers in DuckDuckGo sidebar (powered by GPT-4!) Install / Readme / Discuss

GoogleGPT

Display ChatGPT answers in Google Search sidebar (powered by GPT-4!) Install / Readme / Discuss

🧠 Contributors

This library exists thanks to code, translations, issues & ideas from the following contributors:

🤝 Partners

chatgpt.js is funded in part by:

Releases / Userguide / Discuss / Back to top ↑