# @types/timestring

> TypeScript definitions for timestring

Latest version **7.0.0** (published 2024-10-18) · MIT license · 0 weekly downloads

## Install

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

## 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 | 7.0.0 |
| Published | 2024-10-18 |
| First published | 2020-12-23 |
| 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 | 51438 |
| Maintainers | types |

## Links

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

## Recent versions

- 7.0.0 (latest) — 2024-10-18
- 6.0.5 (ts4.7) — 2023-11-07
- 6.0.3 (ts4.4) — 2023-09-12
- 6.0.2 (ts4.2) — 2021-07-02
- 6.0.0 (ts3.3) — 2020-12-23
- 6.0.4 — 2023-10-18
- 6.0.1 — 2021-05-30

## README

# Installation
> `npm install --save @types/timestring`

# Summary
This package contains type definitions for timestring (https://github.com/mike182uk/timestring).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/timestring.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/timestring/index.d.ts)
````ts
declare function timestring(
    input: string | number,
    returnUnit?: timestring.ReturnUnit,
    opts?: timestring.Options,
): number;

declare namespace timestring {
    type ReturnUnit =
        | "ms"
        | "milli"
        | "millisecond"
        | "milliseconds"
        | "s"
        | "sec"
        | "secs"
        | "second"
        | "seconds"
        | "m"
        | "min"
        | "mins"
        | "minute"
        | "minutes"
        | "h"
        | "hr"
        | "hrs"
        | "hour"
        | "hours"
        | "d"
        | "day"
        | "days"
        | "w"
        | "week"
        | "weeks"
        | "mon"
        | "mth"
        | "mths"
        | "month"
        | "months"
        | "y"
        | "yr"
        | "yrs"
        | "year"
        | "years";

    interface Options {
        /**
         * @default 24
         */
        hoursPerDay?: number | undefined;
        /**
         * @default 7
         */
        daysPerWeek?: number | undefined;
        /**
         * @default 4
         */
        weeksPerMonth?: number | undefined;
        /**
         * @default 12
         */
        monthsPerYear?: number | undefined;
        /**
         * @default 365.25s
         */
        daysPerYear?: number | undefined;
    }
}

export = timestring;

````

### Additional Details
 * Last updated: Fri, 18 Oct 2024 21:36:41 GMT
 * Dependencies: none

# Credits
These definitions were written by [Devin Spikowski](https://github.com/vegeta897).

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