# @types/ms

> TypeScript definitions for ms

Latest version **2.1.0** (published 2025-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/ms
pnpm add @types/ms
yarn add @types/ms
bun add @types/ms
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2025-01-16 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/ms
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms
- npm.io page: https://npm.io/package/@types/ms

## Recent versions

- 2.1.0 (latest) — 2025-01-16
- 0.7.34 (ts4.5) — 2023-11-07
- 0.7.31 (ts2.1) — 2019-09-04
- 0.7.33 — 2023-10-18
- 0.7.32 — 2023-09-27
- 0.7.30 — 2017-08-21
- 0.7.29 — 2016-09-19
- 0.7.28 — 2016-07-14
- 0.7.27-alpha — 2016-07-08
- 0.7.26-alpha — 2016-07-04
- 0.7.25-alpha — 2016-07-02
- 0.7.24-alpha — 2016-07-01
- 0.7.23-alpha — 2016-07-01
- 0.7.22-alpha — 2016-05-25
- 0.7.21-alpha — 2016-05-20
- … 2 more at https://npm.io/package/@types/ms/versions

## README

# Installation
> `npm install --save @types/ms`

# Summary
This package contains type definitions for ms (https://github.com/vercel/ms).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms/index.d.ts)
````ts
/**
 * Short/Long format for `value`.
 *
 * @param {Number} value
 * @param {{long: boolean}} options
 * @return {String}
 */
declare function ms(value: number, options?: { long: boolean }): string;

/**
 * Parse the given `value` and return milliseconds.
 *
 * @param {ms.StringValue} value
 * @return {Number}
 */
declare function ms(value: ms.StringValue): number;

declare namespace ms {
    // Unit, UnitAnyCase, and StringValue are backported from ms@3
    // https://github.com/vercel/ms/blob/8b5923d1d86c84a9f6aba8022d416dcf2361aa8d/src/index.ts

    type Unit =
        | "Years"
        | "Year"
        | "Yrs"
        | "Yr"
        | "Y"
        | "Weeks"
        | "Week"
        | "W"
        | "Days"
        | "Day"
        | "D"
        | "Hours"
        | "Hour"
        | "Hrs"
        | "Hr"
        | "H"
        | "Minutes"
        | "Minute"
        | "Mins"
        | "Min"
        | "M"
        | "Seconds"
        | "Second"
        | "Secs"
        | "Sec"
        | "s"
        | "Milliseconds"
        | "Millisecond"
        | "Msecs"
        | "Msec"
        | "Ms";

    type UnitAnyCase = Unit | Uppercase<Unit> | Lowercase<Unit>;

    type StringValue =
        | `${number}`
        | `${number}${UnitAnyCase}`
        | `${number} ${UnitAnyCase}`;
}

export = ms;

````

### Additional Details
 * Last updated: Thu, 16 Jan 2025 21:02:45 GMT
 * Dependencies: none

# Credits
These definitions were written by [Zhiyuan Wang](https://github.com/danny8002).

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