# react-pretty-duration

> Reactjs tinny package to convert numbered duration to human friendly text.

Latest version **1.1.1** (published 2021-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-pretty-duration
pnpm add react-pretty-duration
yarn add react-pretty-duration
bun add react-pretty-duration
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2021-02-02 |
| First published | 2020-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 144.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | AbdulRehman |
| Maintainers | abdulrehman3 |
| Keywords | react, react-pretty-duration, react-component, duration, time, parser |

## Links

- npm: https://www.npmjs.com/package/react-pretty-duration
- Repository: https://github.com/AbdulRehman3/react-pretty-duration
- Issues: https://github.com/AbdulRehman3/react-pretty-duration/issues
- npm.io page: https://npm.io/package/react-pretty-duration

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.4

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2021-02-02
- 1.1.0 — 2020-08-31
- 1.0.0 — 2020-08-30

## README

# react-pretty-duration

![npm bundle size](https://img.shields.io/bundlephobia/min/react-pretty-duration)
![npm](https://img.shields.io/npm/dt/react-pretty-duration)
![npm](https://img.shields.io/npm/v/react-pretty-duration)
![NPM](https://img.shields.io/npm/l/react-pretty-duration)

react-pretty-duration is a reactjs package converting numbered duration to user friendly duration text.

## Installation

Use the npm to install react-pretty-duration.

```bash
npm install react-pretty-duration
```

## Usage

```jsx
import React from 'react';
import PrettyDuration from 'react-pretty-duration';

const App = () => {
	return (
		// provide total minutes
		<PrettyDuration duration={200} />
	)
}
// result => 3hr 20min
```

## Demo

[react-pretty-duration](https://codesandbox.io/s/react-pretty-duration-2krwk)

## Props

| props    | type   | default | description                               | required |
|----------|--------|---------|-------------------------------------------|----------|
| duration | number | 0       | numbered duration in minutes, must be greater than 0 | true     |
| className| string | 0       | className for element styling             | false    |
| style    | style object | 0 | object for inline styling                 | false    |


## Notice
This package uses react hooks, so would works with react@16.8 or greater

## License
MIT

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