# timelabel

> convert time lengths into a nice formatted string

Latest version **1.2.0** (published 2016-07-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-07-05 |
| First published | 2014-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rory Bradford |
| Maintainers | roryrjb |
| Keywords | time, length, string |

## Links

- npm: https://www.npmjs.com/package/timelabel
- Repository: https://github.com/roryrjb/timelabel
- Issues: http://github.com/roryrjb/timelabel/issues
- npm.io page: https://npm.io/package/timelabel

## 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.2.0 (latest) — 2016-07-05
- 1.1.1 — 2015-06-21
- 1.1.0 — 2015-06-21
- 1.0.3 — 2014-12-07
- 1.0.2 — 2014-11-02
- 1.0.1 — 2014-05-04

## README

# timelabel [![Build Status](https://travis-ci.org/roryrjb/timelabel.svg?branch=master)](https://travis-ci.org/roryrjb/timelabel) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

> Convert time lengths (intervals) into a nice formatted string.

### Installation

```
$ npm install timelabel
```

__Test:__

```
$ npm test
```

### Usage/API

__timelabel(number, [detail])__

The function takes a number as its only required argument, assuming the number is a millisecond length and converts longer lengths it to a nicer format. If the `detail` argument is set to _true_ then it will return more detail. See examples below.

__Examples:__

```javascript
var timelabel = require('timelabel')

// milliseconds
timelabel(150) // '150 milliseconds'

// seconds
timelabel(2400) // '2 seconds'

// minutes
timelabel(200000) // '3 minutes'
timelabel(200000, true) // '3m 20s'

// hours
timelabel(38000000) // '11 hours'
timelabel(38000000, true) // '10h 33m'

// days
timelabel(3810000000) // '44 days'
timelabel(3810000000, true) // '44d 2h'
```

### License

MIT

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