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

check4ai

v0.0.2-beta

Published

A tool that can detect ai content

Downloads

11

Readme

check4ai

NPM Version code style: prettier NPM Downloads Codecov Coverage Status

You deserve to know who is the actual author a text! A human or a machine? Check4Ai is a javascript library which helps you to figure out whether a text written by a human or an AI like ChatGPT.

Disclaimer:

This library has beta version for now. Some functions may not be able to not work properly.

Getting Started

Make sure you have Node.js installed. To run this locally, you first need to install the dependencies. Run the following:

npm install check4ai

Usage

If you have to use plagiarism detector, it is default used by check4ai, you have to get G_API_KEY. Then you have to add an .env file in your project root. So that you can add following to:

G_API_KEY=<YOUR-API-KEY-FROM-GOOGLE-CONSOLE>
G_ENGINE_ID=<YOUR-ENGINE-ID-FROM-GOOGLE-CONSOLE>

You can use default checker methor with check4ai.checkText()

const check4ai = require("check4ai")()
const targetText = `In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.\n' +
    'The scientist named the population, after their distinctive horn, Ovid\'s Unicorn. These four-horned, silver-white unicorns were previously unknown to science.\n' +
    'Now, after almost two centuries, the mystery of what sparked this odd phenomenon is finally solved.\n' +
    'Dr. Jorge Pérez, an evolutionary biologist from the University of La Paz, and several companions, were exploring the Andes Mountains when they found a small valley, with no other animals or humans. Pérez noticed that the valley had what appeared to be a natural fountain, surrounded by two peaks of rock and silver snow.\n' +
    'Pérez and the others then ventured further into the valley. "By the time we reached the top of one peak, the water looked blue, with some crystals on top," said Pérez.\n' +
    'Pérez and his friends were astonished to see the unicorn herd. These creatures could be seen from the air without having to move too much to see them – they were so close they could touch their horns.\n' +
    'While examining these bizarre creatures the scientists discovered that the creatures also spoke some fairly regular English. Pérez stated, "We can see, for example, that they have a common \'language,\' something like a dialect or dialectic."\n' +
    'Dr. Pérez believes that the unicorns may have originated in Argentina, where the animals were believed to be descendants of a lost race of people who lived there before the arrival of humans in those parts of South America.\n' +
    'While their origins are still unclear, some believe that perhaps the creatures were created when a human and a unicorn met each other in a time before human civilization. According to Pérez, "In South America, such incidents seem to be quite common."\n' 
    'However, Pérez also pointed out that it is likely that the only way of knowing for sure if unicorns are indeed the descendants of a lost alien race is through DNA. "But they seem to be able to communicate in English quite well, which I believe is a sign of evolution, or at least a change in social organization," said the scientist.`
const result = check4ai.checkText({text: targetText})
console.log(result)

Or if you want to detect something with specific detector, you can pick particular detectors in check4ai.detectors list

const detectors = require("check4ai")()
const targetText = `In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.\n' +
    'The scientist named the population, after their distinctive horn, Ovid\'s Unicorn. These four-horned, silver-white unicorns were previously unknown to science.\n' +
    'Now, after almost two centuries, the mystery of what sparked this odd phenomenon is finally solved.\n' +
    'Dr. Jorge Pérez, an evolutionary biologist from the University of La Paz, and several companions, were exploring the Andes Mountains when they found a small valley, with no other animals or humans. Pérez noticed that the valley had what appeared to be a natural fountain, surrounded by two peaks of rock and silver snow.\n' +
    'Pérez and the others then ventured further into the valley. "By the time we reached the top of one peak, the water looked blue, with some crystals on top," said Pérez.\n' +
    'Pérez and his friends were astonished to see the unicorn herd. These creatures could be seen from the air without having to move too much to see them – they were so close they could touch their horns.\n' +
    'While examining these bizarre creatures the scientists discovered that the creatures also spoke some fairly regular English. Pérez stated, "We can see, for example, that they have a common \'language,\' something like a dialect or dialectic."\n' +
    'Dr. Pérez believes that the unicorns may have originated in Argentina, where the animals were believed to be descendants of a lost race of people who lived there before the arrival of humans in those parts of South America.\n' +
    'While their origins are still unclear, some believe that perhaps the creatures were created when a human and a unicorn met each other in a time before human civilization. According to Pérez, "In South America, such incidents seem to be quite common."\n' 
    'However, Pérez also pointed out that it is likely that the only way of knowing for sure if unicorns are indeed the descendants of a lost alien race is through DNA. "But they seem to be able to communicate in English quite well, which I believe is a sign of evolution, or at least a change in social organization," said the scientist.`
const result = check4ai.checkText({text: targetText})
console.log(result)

Tests:

npm run test

Credits

Thanks to Hendrik Strobelt, Sebastian Gehrmann, and Alexander Rush from the MIT-IBM Watson AI lab and Harvard NLP for creating an awesome Giant Language Model GLTR!

Thanks to hhhhhhhhhn for HookeJS for creating an awesome Giant Language Model)!

Note

This package can a google custom search api key and engine id, which can be accesed through function parameters or the G_API_KEY and G_ENGINE_ID enviroment variables. If not provided, it will scrape the results (use at your own risk)