Generating `robots.txt` from config, including AI-crawler controls.
Overview
Typed per-user-agent rules, sitemap refs, a parser, framework presets (Next.js, WordPress, Shopify) and an isAllowed() crawlability matcher — plus a one-liner to block AI crawlers (GPTBot, ClaudeBot, CCBot, Google-Extended and 14 more).
Install
$ npm install @lacspace/robots
Quick example
@lacspace/robotsts
blockAiBots({ sitemap: "/sitemap.xml" })
Returns robots.txt
Tips
`robotsForSite(site.config)` keeps robots in sync with your canonical host and sitemap URL.
Zero-dependency and isomorphic — safe to import on the server, in the browser, on the edge and in React Native. It tree-shakes, so you only ship what you import.