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

@gizzixz/slop.js

v1.1.0

Published

Never trust your own code again — have AI generate and eval it for you, with automatic error-retry loops.

Downloads

347

Readme

slop.js

Never trust your own code again with slop.js, have AI generate your code each time you want to do something.

It will .eval() the code you prompt it to make every single fucking time. Oh there's also no sandboxing or protection.

Why?

I don't know.

When?

Hopefully never.

What (the fuck)?

Any and all further questions will go through my lawyer.

How it works

  1. You give slop() a prompt.
  2. It asks an AI model to write the JavaScript code.
  3. It eval()s the generated code completely raw with no protection.
  4. If the code throws, the error is fed back to the AI and it tries again, up to maxRetries times.
  5. The function is async, so you can await it before running the next call.

Installation

npm install @gizzixz/slop.js

Usage

const slop = require('slop.js');

// Set your OpenAI API key (or pass it via the options object)
process.env.OPENAI_API_KEY = 'sk-...';

(async () => {
  // Generates code, evals it, returns the result.
  // If the code errors, the AI fixes it automatically.
  const result = await slop('write code that returns the sum of 1 through 10');
  console.log(result); // 55

  // You can await each call before moving on to the next.
  const greeting = await slop('write code that returns "Hello, world!"');
  console.log(greeting); // Hello, world!
})();

Options

const result = await slop('your prompt here', {
  provider:   'openai',   // AI provider: "openai" (default) or "anthropic"
  apiKey:     'sk-...',   // API key (default: OPENAI_API_KEY or ANTHROPIC_API_KEY env var)
  baseURL:    '...',      // Custom base URL for OpenAI-compatible providers (see below)
  model:      'gpt-4o',   // Model to use (default: "gpt-4o" for OpenAI, "claude-opus-4-5" for Anthropic)
  maxRetries: 10,         // Max AI fix attempts before throwing (default: 10)
});

Supported providers

OpenAI (default)

process.env.OPENAI_API_KEY = 'sk-...';
const result = await slop('your prompt');

Anthropic (Claude)

process.env.ANTHROPIC_API_KEY = 'sk-ant-...';
const result = await slop('your prompt', { provider: 'anthropic' });

OpenAI-compatible providers

Any provider with an OpenAI-compatible API (Groq, Mistral, Together AI, Perplexity, OpenRouter, Google Gemini, etc.) can be used via the baseURL option:

// Groq
const result = await slop('your prompt', {
  apiKey:   process.env.GROQ_API_KEY,
  baseURL:  'https://api.groq.com/openai/v1',
  model:    'llama-3.3-70b-versatile',
});

// Mistral
const result = await slop('your prompt', {
  apiKey:   process.env.MISTRAL_API_KEY,
  baseURL:  'https://api.mistral.ai/v1',
  model:    'mistral-large-latest',
});

// Google Gemini (OpenAI-compatible endpoint)
const result = await slop('your prompt', {
  apiKey:   process.env.GEMINI_API_KEY,
  baseURL:  'https://generativelanguage.googleapis.com/v1beta/openai/',
  model:    'gemini-2.0-flash',
});

⚠️ Warning

slop.js calls eval() on AI-generated code with zero sandboxing. It will execute whatever the model returns with full access to your Node.js process. Only use it in environments where you accept this risk.