Modules@robinpath/robots

@robinpath/robots

0.1.0Public

robots.txt parsing, generation, URL permission checking, and crawl configuration

@robinpath/robots

robots.txt parsing, generation, URL permission checking, and crawl configuration

Category Functions Auth License

Why use this module?

The robots module lets you:

  • Parse robots.txt content
  • Generate robots.txt
  • Check if URL is allowed
  • Check if URL is disallowed
  • Get crawl delay for agent

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/robots

Quick Start

No credentials needed — start using it right away:

robots.create {"rules": [{"userAgent": "*", "disallow": ["/admin"]}]}

Available Functions

FunctionDescription
robots.parseParse robots.txt content
robots.createGenerate robots.txt
robots.isAllowedCheck if URL is allowed
robots.isDisallowedCheck if URL is disallowed
robots.getCrawlDelayGet crawl delay for agent
robots.getSitemapsGet sitemap URLs
robots.getRulesGet rules for agent
robots.addRuleAdd rule to robots config
robots.removeRuleRemove rule by user agent
robots.addSitemapAdd sitemap URL
robots.allowAllGenerate allow-all robots.txt
robots.disallowAllGenerate disallow-all robots.txt
robots.fetchFetch and parse robots.txt from URL

Examples

Generate robots.txt

robots.create {"rules": [{"userAgent": "*", "disallow": ["/admin"]}]}

Check if URL is allowed

robots.isAllowed $robots "/page" "Googlebot"

Check if URL is disallowed

robots.isDisallowed $robots "/admin"

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/robots";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  robots.create {"rules": [{"userAgent": "*", "disallow": ["/admin"]}]}
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/robots
Version0.1.0
LicenseMIT
Unpacked Size5.3 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

web