# durationts

> A TypeScript library for parsing ISO 8601 formatted duration strings.

Latest version **0.1.2** (published 2023-02-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2023-02-13 |
| First published | 2023-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jordan |
| Maintainers | lifeline1337 |

## Links

- npm: https://www.npmjs.com/package/durationts
- Repository: https://github.com/lifeline1337/durationts
- Homepage: https://github.com/lifeline1337/durationts#readme
- Issues: https://github.com/lifeline1337/durationts/issues
- npm.io page: https://npm.io/package/durationts

## Recent versions

- 0.1.2 (latest) — 2023-02-13
- 0.1.1 — 2023-02-12
- 0.1.0 — 2023-02-12

## README

# durationts
A TypeScript library for parsing ISO 8601 formatted duration strings.

## Features
*  Parsing available for three duration string formats:
	*  P[#Y][#M][#D]T[#H][#M][#S]  or  P#W
	*  PYYYY-MM-DDTHH:MM:SS
	*  PYYYYMMDDTHHMMSS

## Installation
`npm install --save durationts`

## Examples

```javascript
// A duration of 10 years, 10 months, 10 days, 10 hours, 10 minutes and 10 seconds
let duration = new Duration('P10Y10M10DT10H10M10S');
duration.inYears(); // 10.861871654551917
duration.inMonths(); // 130.34260260118842
duration.inWeeks(); // 566.7445324074074
duration.inDays(); // 3967.211726851852
duration.inHours(); // 95213.08144444444
duration.inMinutes(); // 5712784.886666667
duration.inSeconds(); // 342767093.2
```

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