0.0.2 • Published 7 years ago

robogen v0.0.2

Weekly downloads
12
License
MIT
Repository
github
Last release
7 years ago

robogen

Robots.txt generator done right.

Takes an array of objects that describe rules. Converts them to an appropriate robots.txt.

Usage

Generate a robots.txt:

import robogen from 'robogen'

const robotsTXT = robogen([{
	userAgent: '*',
	allow: '/',
	disallow: ['/secret', '/private']
}, {
	userAgent: ['Bingbot', 'MSNBot'],
	disallow: '/'
}])

console.log(robotsTXT)

This will output

User-agent: *
Allow: /
Disallow: /secret
Disallow: /private
User-agent: Bingbot
User-agent: MSNBot
Disallow: /

Install

With npm installed, run

$ npm install robogen

Acknowledgments

robogen was inspired by robots-generator

See Also

License

MIT