# milliseconds

> Insanely lightweight module for converting times to milliseconds.

Latest version **1.0.3** (published 2014-06-02) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2014-06-02 |
| First published | 2014-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/milliseconds) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 62 |
| Author | Henrik Joreteg |
| Maintainers | henrikjoreteg |
| Keywords | time, conversion, milliseconds |

## Links

- npm: https://www.npmjs.com/package/milliseconds
- Repository: https://github.com/henrikjoreteg/milliseconds
- Issues: https://github.com/henrikjoreteg/milliseconds/issues
- npm.io page: https://npm.io/package/milliseconds

## 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.0.3 (latest) — 2014-06-02
- 1.0.2 — 2014-06-02
- 1.0.1 — 2014-06-02
- 1.0.0 — 2014-06-01

## README

# milliseconds

Insanely lightweight module for converting times to milliseconds.

Literally 9 lines of code, it's just to make writing time in a way that's more readable without having to remember how many milliseconds are in a day, week, month, year.

For those curious, the exact definition of "years" and "months" can vary slighly but these are based on the Julian Year which is 365.25 days of 86400 seconds (http://en.wikipedia.org/wiki/Year) and a month is simply 1/12th of that. 

## install

```
npm install milliseconds
```

## example

```javascript
var ms = require('milliseconds');

ms.seconds(2); // 2000
ms.minutes(2); // 120000
ms.hours(2);   // 7200000
ms.days(2);    // 172800000
ms.weeks(2);   // 1209600000
ms.months(2);  // 5259600000
ms.years(2);   // 63115200000
```

## credits

If you like this follow [@HenrikJoreteg](http://twitter.com/henrikjoreteg) on twitter.

## license

MIT

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