New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hapi-robots

Package Overview
Dependencies
Maintainers
6
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-robots

Hapi plugin to serve up robots.txt

  • 3.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7K
increased by64.46%
Maintainers
6
Weekly downloads
 
Created
Source

hapi-robots

Hapi plugin for serving up robots.txt

installation

'npm install hapi-robots'

usage

const Hapi = require('hapi');
const hapiRobots = require('hapi-robots');

server = new Hapi.Server();
server.connection();
server.register({
  register: hapiRobots,
  options: {
    .........
  }
});

where options is an object of the form:

{
  // set to true to use server.log to report info about robots.txt and remote attempts to access it:
  debug: false,
  envs: {
    production: {
      // will disallow *all* robots from the path '/noDroidsAllowed':
      '*': ['/noDroidsAllowed'],
      // will disallow robot 'R2D2' from the indicated paths:
      'R2D2': ['/noDroidsAllowed', '/noR2D2Here']
    },
    stage: {
      // will disallow everyone from every path:
      '*': ['/'],
      // except for chuck, chuck is awesome:
      'chuck': []
    },
    // use '*' to match match any other env that isn't listed above:
    '*': ['/']
  },
  // tell hapi-robots which of the above envs to use:
  env: 'production'
}

see folder /test for more examples

Keywords

FAQs

Package last updated on 19 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc