# simple-last-seen

> A lightweight javascript package that returns how long ago the time passed in was

Latest version **1.0.1** (published 2023-10-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install simple-last-seen
pnpm add simple-last-seen
yarn add simple-last-seen
bun add simple-last-seen
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-10-25 |
| First published | 2023-10-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Taofeeq Oluderu |
| Maintainers | taofeeq-deru |
| Keywords | last seen, last-seen, npm, react, angular, vue, javascript, time, date, long ago, long-ago |

## Links

- npm: https://www.npmjs.com/package/simple-last-seen
- Repository: https://github.com/Taofeeq-deru/simple-last-seen
- Homepage: https://github.com/Taofeeq-deru/simple-last-seen#readme
- Issues: https://github.com/Taofeeq-deru/simple-last-seen/issues
- npm.io page: https://npm.io/package/simple-last-seen

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-10-25
- 1.0.0 — 2023-10-22

## README

# simple-last-seen

It is a simple light weight JavaScript package that returns relative date/time. It returns how long ago a time/date was or how long left to get to a time/date.

## ¶Installation

```js
npm install simple-last-seen --save
//or with yarn
yarn add simple-last-seen
```

## ¶Usage

```js
import RelativeTime from "simple-last-seen";

const past = new Date("2014-01-01");
const future = new Date("2050-12-01");

const today = new Date("2023-10-22");

RelativeTime.lastSeenAgo(past, today);
//=> 11 years ago

RelativeTime.fromNow(future, today);
//=> in 30 years
```

today is an optional parameter in the methods, when not passed, RelativeTime picks the current date/time as today.

The methods also takes a third parameter, the text to show when today === past/futrue or is just a second from past/future.

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