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.
- Host: GitHub
- URL: https://github.com/mskelton/time-ago
- Owner: mskelton
- License: isc
- Created: 2022-03-01T04:06:09.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-25T04:28:28.000Z (over 3 years ago)
- Last Synced: 2024-10-18T08:18:00.582Z (over 1 year ago)
- Topics: intl, relativetimeformat, time
- Language: TypeScript
- Homepage:
- Size: 1020 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @mskelton/time-ago
[](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
```