# nuxt-content-hooks-git

> nuxt-content hooks that replace or add createdAt and updatedAt dates based on the git history.

Latest version **1.0.7** (published 2021-04-12) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install nuxt-content-hooks-git
pnpm add nuxt-content-hooks-git
yarn add nuxt-content-hooks-git
bun add nuxt-content-hooks-git
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-04-12 |
| First published | 2021-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Sebastian Landwehr |
| Maintainers | dword-design |

## Links

- npm: https://www.npmjs.com/package/nuxt-content-hooks-git
- Repository: https://github.com/dword-design/nuxt-content-hooks-git
- Homepage: https://github.com/dword-design/nuxt-content-hooks-git#readme
- Issues: https://github.com/dword-design/nuxt-content-hooks-git/issues
- Funding: https://www.buymeacoffee.com/dword
- npm.io page: https://npm.io/package/nuxt-content-hooks-git

## Dependencies (2)

- [simple-git](https://npm.io/package/simple-git.md) ^2.37.0
- [@dword-design/functions](https://npm.io/package/@dword-design/functions.md) ^3.0.0

## Recent versions

- 1.0.7 (latest) — 2021-04-12
- 1.0.6 — 2021-04-05
- 1.0.5 — 2021-03-23
- 1.0.4 — 2021-03-22
- 1.0.3 — 2021-03-22
- 1.0.2 — 2021-03-22
- 1.0.1 — 2021-03-18
- 1.0.0 — 2021-03-18

## README

<!-- TITLE/ -->
# nuxt-content-hooks-git
<!-- /TITLE -->

<!-- BADGES/ -->
  <p>
    <a href="https://npmjs.org/package/nuxt-content-hooks-git">
      <img
        src="https://img.shields.io/npm/v/nuxt-content-hooks-git.svg"
        alt="npm version"
      >
    </a><img src="https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue" alt="Linux macOS Windows compatible"><a href="https://github.com/dword-design/nuxt-content-hooks-git/actions">
      <img
        src="https://github.com/dword-design/nuxt-content-hooks-git/workflows/build/badge.svg"
        alt="Build status"
      >
    </a><a href="https://codecov.io/gh/dword-design/nuxt-content-hooks-git">
      <img
        src="https://codecov.io/gh/dword-design/nuxt-content-hooks-git/branch/master/graph/badge.svg"
        alt="Coverage status"
      >
    </a><a href="https://david-dm.org/dword-design/nuxt-content-hooks-git">
      <img src="https://img.shields.io/david/dword-design/nuxt-content-hooks-git" alt="Dependency status">
    </a><img src="https://img.shields.io/badge/renovate-enabled-brightgreen" alt="Renovate enabled"><br/><a href="https://gitpod.io/#https://github.com/dword-design/nuxt-content-hooks-git">
      <img
        src="https://gitpod.io/button/open-in-gitpod.svg"
        alt="Open in Gitpod"
        height="32"
      >
    </a><a href="https://www.buymeacoffee.com/dword">
      <img
        src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"
        alt="Buy Me a Coffee"
        height="32"
      >
    </a><a href="https://paypal.me/SebastianLandwehr">
      <img
        src="https://dword-design.de/images/paypal.svg"
        alt="PayPal"
        height="32"
      >
    </a><a href="https://www.patreon.com/dworddesign">
      <img
        src="https://dword-design.de/images/patreon.svg"
        alt="Patreon"
        height="32"
      >
    </a>
</p>
<!-- /BADGES -->

<!-- DESCRIPTION/ -->
nuxt-content hooks that replace or add createdAt and updatedAt dates based on the git history.
<!-- /DESCRIPTION -->

ℹ️ **There is also a [Nuxt.js module](https://github.com/dword-design/nuxt-content-git) that does the same thing and is probably cleaner to use.**

<!-- INSTALL/ -->
## Install

```bash
# npm
$ npm install nuxt-content-hooks-git

# Yarn
$ yarn add nuxt-content-hooks-git
```
<!-- /INSTALL -->

## Usage

Add the hooks to your hooks config:

```js
import nuxtContentHooksGit from 'nuxt-content-hooks-git'

export default {
  hooks: {
    ...
    ...nuxtContentHooksGit(),
  },
}
```

This will replace `doc.createdAt` and `doc.updatedAt` with the dates from the Git log.

It is also possible to not override the values but instead specify the field names like this:

```js
import nuxtContentHooksGit from 'nuxt-content-hooks-git'

export default {
  hooks: {
    ...
    ...nuxtContentHooksGit({ createdAtName: 'gitCreatedAt', updatedAtName: 'gitUpdatedAt' }),
  },
}
```

Then you can access them via `doc.gitCreatedAt` and `doc.gitUpdatedAt`.

<!-- LICENSE/ -->
## Contribute

Are you missing something or want to contribute? Feel free to file an [issue](https://github.com/dword-design/nuxt-content-hooks-git/issues) or a [pull request](https://github.com/dword-design/nuxt-content-hooks-git/pulls)! ⚙️

## Support

Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:

<p>
  <a href="https://www.buymeacoffee.com/dword">
    <img
      src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"
      alt="Buy Me a Coffee"
      height="32"
    >
  </a>&nbsp;If you want to send me a one time donation. The coffee is pretty good 😊.<br/>
  <a href="https://paypal.me/SebastianLandwehr">
    <img
      src="https://dword-design.de/images/paypal.svg"
      alt="PayPal"
      height="32"
    >
  </a>&nbsp;Also for one time donations if you like PayPal.<br/>
  <a href="https://www.patreon.com/dworddesign">
    <img
      src="https://dword-design.de/images/patreon.svg"
      alt="Patreon"
      height="32"
    >
  </a>&nbsp;Here you can support me regularly, which is great so I can steadily work on projects.
</p>

Thanks a lot for your support! ❤️

## License

[MIT License](https://opensource.org/licenses/MIT) © [Sebastian Landwehr](https://dword-design.de)
<!-- /LICENSE -->

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