# humanize-from-now

> A tiny function that generates momentjs like time from now string.

Latest version **0.0.3** (published 2019-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install humanize-from-now
pnpm add humanize-from-now
yarn add humanize-from-now
bun add humanize-from-now
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-04-11 |
| First published | 2019-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leon Chen |
| Maintainers | leonchen |
| Keywords | fromnow, duration, human |

## Links

- npm: https://www.npmjs.com/package/humanize-from-now
- Repository: https://github.com/leonchen/humanize-from-now
- Homepage: https://github.com/leonchen/humanize-from-now#readme
- Issues: https://github.com/leonchen/humanize-from-now/issues
- npm.io page: https://npm.io/package/humanize-from-now

## Recent versions

- 0.0.3 (latest) — 2019-04-11
- 0.0.2 — 2019-04-11
- 0.0.1 — 2019-04-10

## README

# humanize-from-now
Generates momentjs like time from now string


## About this project
This is a tiny function to genrate the momentjs like time-from-now string. Checkout the [momentjs doc](http://momentjs.com/docs/#/displaying/fromnow/) for the definitions.

## Installation
```
npm install --save humanize-from-now
```

## Usage
First import this module in your code:

```
import fromNow from 'humanize-from-now';
```
Then you can use it like:

```
const duration = fromNow(time);
```
the `time` argument could be the numeric timestamp in milliseconds, a valid js Date string or a js Date object.


you can also set a failover string when the input time is not valid:

```
const duration = fromNow(time, 'Invalid date');
```
and... That's it! Have fun!

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