# dot-beat-time

> Convert legacy time to decimal internet time, or beats.

Latest version **1.2.1** (published 2019-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install dot-beat-time
pnpm add dot-beat-time
yarn add dot-beat-time
bun add dot-beat-time
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2019-07-11 |
| First published | 2019-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Maintainers | sgwil |
| Keywords | internet time, beats, beat time, .beat, decimal time |

## Links

- npm: https://www.npmjs.com/package/dot-beat-time
- Repository: https://github.com/sgwilym/dot-beat-time
- npm.io page: https://npm.io/package/dot-beat-time

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2019-07-11
- 1.2.0 — 2019-07-10
- 1.1.1 — 2019-07-10
- 1.0.0 — 2019-07-06

## README

# dot-beat-time

`dot-beat-time` is a small (0.3kb), fast, dependency-free package for getting beat internet time.

## Motivation

The millennium is upon us. The age of the internet arrived long ago. Why are we still coordinating meetings across timezones? Fortunately internet time — which splits the day into 1000 beats and which is consistent across the world — is here to fix all that.

Example: you are in central Europe and wish to organise a meeting with your friend in Tokyo during your lunch. Instead of calculating what time it is in Tokyo then, just tell your friend: "let's talk at @500!".

## Installation

Install locally:

`yarn add dot-beat-time`

Alternatively `dot-beat-time` is also published as an ES module, meaning that you can import it directly using CDNs like [pika.dev](https://www.pika.dev/packages/dot-beat-time).

## API

### `fromDate`

`fromDate(date: Date, long?: boolean): string`

Takes a standard JS Date and outputs as an internet time formatted string e.g. `@255`.
If `true` is passed to the second argument, the beat will be fractional e.g. `@255.50`.

### `now`

`fromDate(long?: boolean): string`

Outputs the current time as a internet time formatted string e.g. `@650`.
If `true` is passed to the second argument, the beat will be fractional e.g. `@650.73`.

## Credit

The calculation for determining the current beat time has been taken from the [beats rust crate](https://docs.rs/beats).

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