# @vates/parse-duration

> Small wrapper around ms to parse a duration

Latest version **0.1.1** (published 2021-05-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @vates/parse-duration
pnpm add @vates/parse-duration
yarn add @vates/parse-duration
bun add @vates/parse-duration
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2021-05-05 |
| First published | 2020-06-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.10 |
| Dependencies | 1 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 988 |
| Author | Vates SAS |
| Maintainers | pdonias, julien-f, marsaud, olivierlambert, badraz |
| Keywords | duration, ms, parse |

## Links

- npm: https://www.npmjs.com/package/@vates/parse-duration
- Repository: https://github.com/vatesfr/xen-orchestra
- Homepage: https://github.com/vatesfr/xen-orchestra/tree/master/@vates/parse-duration
- Issues: https://github.com/vatesfr/xen-orchestra/issues
- npm.io page: https://npm.io/package/@vates/parse-duration

## Dependencies (1)

- [ms](https://npm.io/package/ms.md) ^2.1.2

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

- 0.1.1 (latest) — 2021-05-05
- 0.1.0 — 2020-06-12

## README

<!-- DO NOT EDIT MANUALLY, THIS FILE HAS BEEN GENERATED -->

# @vates/parse-duration

[![Package Version](https://badgen.net/npm/v/@vates/parse-duration)](https://npmjs.org/package/@vates/parse-duration) ![License](https://badgen.net/npm/license/@vates/parse-duration) [![PackagePhobia](https://badgen.net/bundlephobia/minzip/@vates/parse-duration)](https://bundlephobia.com/result?p=@vates/parse-duration) [![Node compatibility](https://badgen.net/npm/node/@vates/parse-duration)](https://npmjs.org/package/@vates/parse-duration)

> Small wrapper around ms to parse a duration

## Install

Installation of the [npm package](https://npmjs.org/package/@vates/parse-duration):

```
> npm install --save @vates/parse-duration
```

## Usage

`ms` without magic: always parse a duration and throws if invalid.

```js
import { parseDuration } from '@vates/parse-duration'

parseDuration('2 days')
// 172800000

parseDuration(172800000)
// 172800000

parseDuration(undefined)
// throws TypeError('not a valid duration: undefined')
```

## Contributions

Contributions are _very_ welcomed, either on the documentation or on
the code.

You may:

- report any [issue](https://github.com/vatesfr/xen-orchestra/issues)
  you've encountered;
- fork and create a pull request.

## License

[ISC](https://spdx.org/licenses/ISC) © [Vates SAS](https://vates.fr)

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