Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including koa-robotstxt with all npm packages installed. Try it out:

var koaRobotstxt = require("koa-robotstxt")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

koa-robotstxt v1.0.10

Robots.txt bounce middleware for koa

koa-robotstxt Build Status

Koa middleware for serving the robots.txt file..


$ npm install koa-robotstxt


var koa = require('koa');
var robotstxt = require('koa-robotstxt');
var app = koa();

app.use(robotstxt(__dirname + '/public/robots.txt'));


robotstxt(path, [options])

Returns a middleware serving the robots.txt found on the given path.


  • maxAge cache-control max-age directive in ms, defaulting to 1 day.



RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free