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

@awmottaz/eleventy-plugin-block-ai

v1.0.1

Published

Block AI crawlers on your 11ty site, powered by ai.robots.txt

Readme

@awmottaz/eleventy-plugin-block-ai

This plugin uses the data from ai.robots.txt to add files to your site that will block AI bots.

Installation

npm install @awmottaz/eleventy-plugin-block-ai

Internally, this plugin uses 11ty/eleventy-fetch to fetch the ai.robots.txt files. You may want to add the .cache/ directory to your .gitignore file to avoid committing the cached assets.

Usage

Add the plugin to your 11ty configuration file.

import BlockAI from '@awmottaz/eleventy-plugin-block-ai';

export default async function(eleventyConfig) {
    eleventyConfig.addPlugin(BlockAI);
}

By default, this plugin will create only a robots.txt file in your build output. You must explicitly opt in to create other files.

Configuration

Here is the plugin with default configuration:

import BlockAI from '@awmottaz/eleventy-plugin-block-ai';

export default async function(eleventyConfig) {
    eleventyConfig.addPlugin(BlockAI, {
        robots: true,
        htaccess: false,
        nginx: false,
        caddyfile: false,
        haproxy: false,
        cacheDuration: '1d',
    });
}

The boolean-valued options control whether the associated file will be generated. It will have the exact contents as provided by the ai.robots.txt repository at the prescribed file path.

Caching

Internally, this plugin uses 11ty/eleventy-fetch to fetch the ai.robots.txt files. You can edit the cache duration using the cacheDuration configuration option using the cache duration configuration syntax.

Advanced control with the data cascade

If you need extra control over the generated files, you can disable this plugin from generating them. This plugin will add the raw text contents of each ai.robots.txt file to the global data cascade, so you can create your own files using that.

The data is namespaced under ai_robots:

  • ai_robots.robots
  • ai_robots.htaccess
  • ai_robots.nginx
  • ai_robots.caddyfile
  • ai_robots.haproxy

For example, if you want to generate a custom .htaccess file that includes 404 redirects, you could use an 11ty.js template like so:

class HTAccess {
	data() {
		return {
			permalink: ".htaccess",
		};
	}

	async render(data) {
		return `ErrorDocument 404 /404.html\n\n${data.ai_robots.htaccess}`;
	}
}

export default HTAccess;