![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
⚡ A lightweight and simple way to create tools using AI 🪶
PolyFact's goal is to make it possible to code every AI tool/Chatbot you could want in only a couple of lines of code without the need for complex abstractions and having to deploy anything.
You can consult PolyFact's documentation at https://github.com/polyfact/polyfact-node/wiki
We also made a couple of tutorials you can use to get started with Polyfact:
To install polyfact into your repository:
npm install polyfact
Get your polyfact token by signing up with GitHub here: https://app.polyfact.com
Add your PolyFact Token in the POLYFACT_TOKEN
environment variable:
export POLYFACT_TOKEN= # The token displayed on https://app.polyfact.com
There are more examples and tutorials in the Documentation but here's a simple chatbot to get you started:
import * as readline from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";
import { Chat } from "polyfact";
// We use the nodeJS readline API to extract the user inputs from the standard input of the terminal
// It can be change to whatever interface you want the user to interact with, readline is just for
// the example.
const rl = readline.createInterface({ input, output });
async function chatREPL() {
// We initialize a new polyfact chat
const chat = new Chat();
while (true) {
// We retrieve the userInput from the nodeJS readline API
const userInput = await rl.question("> ");
// We get an answer from the polyfact API to the message the user sent
const aiAnswer = await chat.sendMessage(userInput);
// And we print it to the standard output
console.log(aiAnswer);
}
}
chatREPL()
We strive for feedback and want to understand everyone's needs, and you can hang out with us on Discord!
PolyFact is open-source! You can contribute to this package or the API by opening an issue or a PR!
FAQs
PolyFact
The npm package polyfact receives a total of 30 weekly downloads. As such, polyfact popularity was classified as not popular.
We found that polyfact demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.