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

aetherlexlib_js

v0.4.0

Published

An AI library

Readme

AetherLexLib_JS

A lightweight chatbot library. (NOTE: This library needs the user to be connected online to provide results.)

Check out the example at: AetherLexLib AI Chatbot

Table of contents:

How to download??

This project is under "MIT LICENSE" so it is free and you can use it, modify it etc. but only if you included the copy of the license of the project you used.

To get the library do one of these methods:

  • Downloading latest update here

  • Run npm i aetherlexlib_js to dowload it using npm.

  • Link it to your html using:

<script src="https://cdn.skypack.dev/aetherlexlib_js"></script>

After you've downloaded the .zip, extract it and add the "project_build" and "LICENSE" files to your project to start using it.

How to Use the Library??

To use the library, follow the steps below:

Step 1:

  • Add a script tag with type "module" in your HTML.
    Example:
    <script type="module">
        // Your JavaScript code will go here
    </script>

Step 2:

  • Import the library at the beginning of your script.
    Example:
    import { analyzeAndRespond } from './path/to/your/library.js';

Step 3:

  • Prepare your conversation data. Ensure you have a structured dataset for training your AI. You can use a JSON format or text files as necessary.

Step 4:

  • Call the analyzeAndRespond function with user input.
    Example:
    const userInput = "Hello, how are you?";
    const response = await analyzeAndRespond(userInput);
    console.log(response);  // Outputs the AI's response

Step 5:

  • Handle responses appropriately within your application. You can display the response in your user interface or process it further as needed.

Step 6:

  • (Optional) Customize the predefined responses and learning data to fit your specific use case. Modify the arrays in the responses object to add more context and variation.

Example Usage:

Here’s a simple example that ties everything together:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chatbot Example</title>
</head>
<body>
    <div id="chat-container"></div>
    <input type="text" id="user-input" placeholder="Type your message..." />
    <button id="send-button">Send</button>

    <script type="module">
        import { analyzeAndRespond } from './path/to/your/library.js';

        document.getElementById('send-button').addEventListener('click', async () => {
            const inputField = document.getElementById('user-input');
            const userInput = inputField.value;
            const response = await analyzeAndRespond(userInput);
            
            // Display the response
            const chatContainer = document.getElementById('chat-container');
            chatContainer.innerHTML += `<div>User: ${userInput}</div>`;
            chatContainer.innerHTML += `<div>AI: ${response}</div>`;
            
            inputField.value = '';  // Clear the input field
        });
    </script>
</body>
</html>

An example on how to use the engine can be found on "examples" folder, you can test it here: AetherLexLib AI Chatbot

AetherLexAPI

If you are unable to use the library via cdn or npm, you can use the AetherLexAPI directly. This is a simple API that you can use to interact with the AI.

const message = "hello";
const response = await fetch('https://aetherlexlib-js.onrender.com/api/analyze', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({ analyzedResult:message }),
});

if (!response.ok) {
    throw new Error(`Error: ${response.status}`);
}

const data = await response.json();
responseDiv.innerHTML = `<p>Response: ${JSON.stringify(data.processedResult)}</p>`;

Thats it! with this, you can send and recieve messages from the AI.

The body is the most important thing of sending requests and it is also the one that can cause you problems!

You need to exactly add analyzedResult: as the message key and the message as the value. If you do not do this, the AI will not respond and throw and error telling to use analyzedResult:

The response the AI will give, will be in JSON form, but for some reason if you need to just get the response as plain text and not JSON, just add this in the body element along with the analyzedResult:

body: JSON.stringify({ analyzedResult:message, isJson: false })

If isJson is false, then the API would only respond with plain text.

Example:

const response = await fetch('https://aetherlexlib-js.onrender.com/api/analyze', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({ analyzedResult:message, isJson: false }),
});

if (!response.ok) {
    throw new Error(`Error: ${response.status}`);
}

const data = await response.text();
responseDiv.innerHTML = `<p>Response: ${data}</p>`;

Credits

  • This chatbot library uses the "Fuse" library which is licensed under "Apache 2.0".
  • For more knowledge, the AI also uses WikiData which is licensed under CC0.
  • Additionally, the AI utilizes DuckDuckGo for supplementary search data (DuckDuckGo under its own terms).
  • This library incorporates the "Compromise" library (Licensed under MIT).