# time_past

> Time past from current time formatter in words

Latest version **2.0.1** (published 2019-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install time_past
pnpm add time_past
yarn add time_past
bun add time_past
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-05-16 |
| First published | 2018-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | jojitoon |
| Maintainers | jojitoon |
| Keywords | node, datetime |

## Links

- npm: https://www.npmjs.com/package/time_past
- Repository: https://github.com/JojiAndela/time_ago_in_words
- Homepage: https://github.com/JojiAndela/time_ago_in_words#readme
- Issues: https://github.com/JojiAndela/time_ago_in_words/issues
- npm.io page: https://npm.io/package/time_past

## 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

- 2.0.1 (latest) — 2019-05-16
- 2.0.0 — 2019-05-09
- 1.0.4 — 2018-10-22
- 1.0.3 — 2018-10-22
- 1.0.2 — 2018-10-17
- 1.0.1 — 2018-10-17

## README

# Time_Past [![Build Status](https://travis-ci.org/JojiAndela/time_ago_in_words.svg?branch=master)](https://travis-ci.org/JojiAndela/time_ago_in_words) [![Maintainability](https://api.codeclimate.com/v1/badges/34be48802bb6a87ea376/maintainability)](https://codeclimate.com/github/JojiAndela/time_ago_in_words/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/34be48802bb6a87ea376/test_coverage)](https://codeclimate.com/github/JojiAndela/time_ago_in_words/test_coverage)

Time past is a simple package that helps compute the time that has elapsed since a particular date. It converts dates to elapsed time.

It can be headache to write all that code that computes the time that has passed since the current date, hence this package.

## Current Features

1. Compute time elapsed from specific date till now.

## Intended Features

1. Compute time elapsed between two dates.

## Get Started

- Simply download the package as a development dependency with `npm i time_past`.
- Import and use
  
```javascript
import TimePast from 'time_past';

function() {
  const date = '2012-10-10'

  const elapsedTime = TimePast.inWords(data);
  console.log(elapsedTime); // '7 years ago'
}
```

## Documentation

### Methods

**inWords**: This method computes the elapsed time from a previous date till now. The previous date can either be a string or a Javascript Date object. Returned value will be a string.

| Parameters | Type           | Description       | Example      |
|------------|----------------|-------------------|--------------|
| date       | Date || string | The previous date | '2012-10-10' |

#### Example (inWords)

```javascript
const elapsedTime = TimePast.inWords(
  '2012-10-10',
);

console.log(elapsedTime); // '7 years ago'
```

### Contributors

_Jojitoon_: 👨🏿[Profile](https://github.com/JojiAndela)<br />
_Opeoluwa Iyi-Kuyoro_: 👨🏿[Profile](https://github.com/IyiKuyoro) - [WebSite](https://iyikuyoro.com)

### Contributions

**PR Style**: Please use the template you find in the PR message to compose one.

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