# nuxt-robots-module

> A NuxtJS module thats inject a middleware to generate a robots.txt file

Latest version **1.5.1** (published 2019-02-22) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install nuxt-robots-module
pnpm add nuxt-robots-module
yarn add nuxt-robots-module
bun add nuxt-robots-module
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.5.1 |
| Published | 2019-02-22 |
| First published | 2017-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 528 |
| Maintainers | williamdasilva |

## Links

- npm: https://www.npmjs.com/package/nuxt-robots-module
- Repository: https://github.com/WilliamDASILVA/nuxt-robots-module
- Homepage: https://github.com/WilliamDASILVA/nuxt-robots-module#readme
- Issues: https://github.com/WilliamDASILVA/nuxt-robots-module/issues
- npm.io page: https://npm.io/package/nuxt-robots-module

## Recent versions

- 1.5.1 (latest) — 2019-02-22
- 1.5.0 — 2019-02-22
- 1.4.0 — 2019-01-18
- 1.3.0 — 2018-07-03
- 1.2.0 — 2018-04-20
- 1.1.0 — 2017-10-27
- 1.0.1 — 2017-10-24
- 1.0.0 — 2017-10-24

## README

# nuxt-robots-module

[![npm (scoped with tag)](https://img.shields.io/npm/v/nuxt-robots-module/latest.svg?style=flat-square)](https://npmjs.com/package/nuxt-robots-module)
[![CircleCI](https://img.shields.io/circleci/project/github/WilliamDASILVA/nuxt-robots-module.svg?style=flat-square)](https://circleci.com/gh/WilliamDASILVA/nuxt-robots-module)
[![npm](https://img.shields.io/npm/dt/nuxt-robots-module.svg?style=flat-square)](https://npmjs.com/package/nuxt-robots-module)
[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com)

> A NuxtJS module thats inject a middleware to generate a robots.txt file

## Table of Contents

* [Requirements](#requirements)
* [Install](#install)
* [Getting Started](#getting-started)
* [Options](#options)
* [Development](#development)
* [License](#license)

## Requirements

* npm or yarn
* NuxtJS
* NodeJS

## Install

```bash
$ npm install --save nuxt-robots-module
// or
$ yarn add nuxt-robots-module
```

## Getting Started

Add `nuxt-robots-module` to `modules` section of `nuxt.config.js`.

```js
{
  modules: [
    // Simple usage
    'nuxt-robots-module',

    // With options
    ['nuxt-robots-module', {
      /* module options */
      UserAgent: 'Googlebot',
      Disallow: '/',
    }],
 ]
}
```

or even

```js
{
  modules: [
    'nuxt-robots-module',
  ],
  robots: {
    /* module options */
    UserAgent: '*',
    Disallow: '/',
  },
}
```

## Options

The module option parameter can be an `object` (like above) or an `array of objects`.

```js
{
  modules: [
    'nuxt-robots-module',
  ],
  robots: [
    {
      UserAgent: 'Googlebot',
      Disallow: '/users',
    },
    {
      UserAgent: 'Bingbot',
      Disallow: '/admin',
    },
  ],
}
```

### Will generate a /robots.txt

```bash
UserAgent: Googlebot
Disallow: /users
UserAgent: Bingbot
Disallow: /admin
```

## Development

To run the development server, you can either install the dependencies locally by running:

```bash
npm install
```

or using `Docker` with `docker-compose`:

```bash
docker-compose up -d
```

This will run the a dev example through the `3000` port on localhost. You can then see your generated robots.txt in `localhost:3000/robots.txt`.

## License

Robots.txt generate code from https://github.com/weo-edu/express-robots repository.
Project generated with Nuxt module builder.

[MIT License](./LICENSE)

---
_Source: https://npm.io/package/nuxt-robots-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
