An open API service indexing awesome lists of open source software.

https://github.com/mskelton/time-ago

Formats a date using the Intl RelativeTimeFormat API with automatic unit selection.
https://github.com/mskelton/time-ago

intl relativetimeformat time

Last synced: about 1 year ago
JSON representation

Formats a date using the Intl RelativeTimeFormat API with automatic unit selection.

Awesome Lists containing this project

README

          

# @mskelton/time-ago

[![Build status](https://github.com/mskelton/time-ago/workflows/Build/badge.svg)](https://github.com/mskelton/time-ago/actions)

## Installation

### npm

```sh
npm install @mskelton/time-ago
```

### Yarn

```sh
yarn add @mskelton/time-ago
```

## Usage

```js
import timeAgo from "@mskelton/time-ago"

console.log(timeAgo(new Date())) // now
```