# @vue-layout/timeago

> A package containing a timeago component.

Latest version **5.0.1** (published 2023-11-23) · 0 weekly downloads

## Install

```sh
npm install @vue-layout/timeago
pnpm add @vue-layout/timeago
yarn add @vue-layout/timeago
bun add @vue-layout/timeago
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 5.0.1 |
| Published | 2023-11-23 |
| First published | 2023-05-22 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 1 |
| Unpacked size | 40.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Peter Placzek |
| Maintainers | tada5hi |
| Keywords | gravatar, avatar, vue, size, picture |

## Links

- npm: https://www.npmjs.com/package/@vue-layout/timeago
- Repository: https://github.com/tada5hi/vue-layout
- Homepage: https://github.com/tada5hi/vue-layout#readme
- Issues: https://github.com/tada5hi/vue-layout/issues
- npm.io page: https://npm.io/package/@vue-layout/timeago

## Dependencies (1)

- [date-fns](https://npm.io/package/date-fns.md) ^2.30.0

## Recent versions

- 5.0.1 (latest) — 2023-11-23
- 5.0.0 — 2023-11-20
- 3.6.2 — 2023-11-06
- 3.0.0 — 2023-06-26
- 2.4.0 — 2023-05-22
- 2.3.0 — 2023-05-22

## README

# @vue-layout/timeago ⏰

[![npm version](https://badge.fury.io/js/@vue-layout%2Ftimeago.svg)](https://badge.fury.io/js/@vue-layout%2Ftimeago)
[![CI](https://github.com/Tada5hi/vue-layout/actions/workflows/main.yml/badge.svg)](https://github.com/Tada5hi/vue-layout/actions/workflows/main.yml)

A package containing a timeago component.

**Table of Contents**

- [Installation](#installation)
- [Usage](#usage)
  - [Locales](#locales)
- [License](#license)

## Installation

```
$ npm i --save @vue-layout/timeago
```

## Usage

Register the plugin.

```typescript
import install from '@vue-layout/timeago';
import { createApp } from 'vue'

const app = createApp({})

app.use(install, {
    /* set the default locale */
    locale: 'en',
});
```

After the component is registered, it can be used as follows.

```vue
<template>
    <VCTimeago
        :date-time="1684746631769"
        :locale="'en'"
        :auto-update="true"
    />
</template>
```

### Locales

To support other locales, the corresponding locale 
object must be imported from the [date-fns](https://www.npmjs.com/package/date-fns) library.
In the following, this will be shown for the german language.

```typescript
import install from '@vue-layout/timeago';
import { createApp } from 'vue'

import de from 'date-fns/locale/de';

const app = createApp({})

app.use(install, {
    locale: 'de',
    locales: {
        de,
    },
});
```
## License

Made with 💚

Published under [MIT License](./LICENSE).

---
_Source: https://npm.io/package/@vue-layout/timeago · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
