# nestjs-metatags-generator

> SEO meta tags generator for NestJS

Latest version **1.0.3** (published 2020-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install nestjs-metatags-generator
pnpm add nestjs-metatags-generator
yarn add nestjs-metatags-generator
bun add nestjs-metatags-generator
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-12-27 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alivekeep |
| Maintainers | alivekeep |
| Keywords | nodejs, meta tags, seo, html generator, typescript, nestjs |

## Links

- npm: https://www.npmjs.com/package/nestjs-metatags-generator
- Repository: https://github.com/Alivekeep/nestjs-metatags-generator
- Issues: https://github.com/Alivekeep/nestjs-metatags-generator/issues
- npm.io page: https://npm.io/package/nestjs-metatags-generator

## Dependencies (1)

- [metatags-generator](https://npm.io/package/metatags-generator.md) ^1.1.8

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-12-27
- 1.0.2 — 2020-09-06
- 1.0.1 — 2020-08-24
- 1.0.0 — 2020-08-24

## README

# NestJS meta tags generator

[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/nestjs-metatags-generator.svg?style=flat-square
[npm-url]: https://npmjs.org/package/nestjs-metatags-generator
[download-image]: https://img.shields.io/npm/dm/nestjs-metatags-generator.svg?style=flat-square
[download-url]: https://npmjs.org/package/nestjs-metatags-generator

Meta tags generator for NestJS MVC. Should be nice for SEO purposes.

In general, generator can make ~10k records per seconds and use ~80Mb memory for this.
That's mean meta tags generation not be bottleneck with up to 10k RPS.

### Installation

```shell script
npm install nestjs-metatags-generator
```

### How to use

In module file

```typescript
import { MetaTagsGeneratorModule } from 'nestjs-metatags-generator';

@Module({
  imports: [MetaTagsGeneratorModule.register()]
})
export class AppModule {}
```

In controller

```typescript
import { MetaTagsGeneratorService, OpengraphTypes } from 'nestjs-metatags-generator';

@Controller('/')
export class MVCController {
  constructor(private readonly generator: MetaTagsGeneratorService) {}

  @Get('')
  @Render('index-page')
  public async indexPage() {
    const fragments = this.generator.prepare({
      robots: 'index, follow',
      backgroundColor: '#962d2d',
      handheld: 'https://m.example.world',
      canonical: 'https://example.world',
      primaryColor: '#2a797c',
      siteName: 'Example',
      pageType: OpengraphTypes.article,
      description: 'Example site',
      title: 'Example site | Some motivation phrase',
      url: 'https://example.world',
      keywords: 'nestjs, typescript, nodejs, SEO'
    });
    return {
      headFragment: fragments.head
    };
  }
}
```

Finally, you need place HTML output to template, like this:

```html
<!DOCTYPE html>
<html lang="en" prefix="og: http://ogp.me/ns#">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    {{@headFragment}}
  </head>
</html>
```

### Licence

[MIT](./LICENSE)

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