# timecode-emitter

> ```sh yarn add timecode-emitter ```

Latest version **1.0.1** (published 2020-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install timecode-emitter
pnpm add timecode-emitter
yarn add timecode-emitter
bun add timecode-emitter
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-09-01 |
| First published | 2020-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 113.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | timlebrun |

## Links

- npm: https://www.npmjs.com/package/timecode-emitter
- npm.io page: https://npm.io/package/timecode-emitter

## Recent versions

- 1.0.1 (latest) — 2020-09-01
- 1.0.0 — 2020-09-01

## README

NodeJS Timecode Emitter
===

A simple class that given a start time and a framerate, will emit a `frame` event periodically.

## Installation

```sh
yarn add timecode-emitter
```

## Usage

```ts
import { TimecodeEmitter } from 'timecode-emitter';

const startTime = Date.now();
const timecode = new TimecodeEmitter(48, startTime); // Supports weird framerates

timecode
  .onFrame(frame => console.log(`FRAME ${frame.code}`))
  .start();

```

... will output ...

```sh
> node script.js
FRAME 00:01:08:00
FRAME 00:01:08:01
FRAME 00:01:08:02
FRAME 00:01:08:03
FRAME 00:01:08:04
...
```

## `frame` event data

```js
{
  hour: 3,
  minute: 4,
  second: 47,
  frame: 12,
  code: '03:04:47:12'
}
```

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