# stopwatch.js

> A Stopwatch for JavaScript.

Latest version **1.1.1** (published 2017-11-19) · MIT License license · 0 weekly downloads

## Install

```sh
npm install stopwatch.js
pnpm add stopwatch.js
yarn add stopwatch.js
bun add stopwatch.js
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2017-11-19 |
| First published | 2017-11-12 |
| Weekly downloads | 0 |
| License | MIT License |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Rajeev Sharma |
| Maintainers | rajeevsharma |
| Keywords | timer, timerjs, timer.js, stopwatch, stopwatch.js, stopwatchjs |

## Links

- npm: https://www.npmjs.com/package/stopwatch.js
- Repository: https://github.com/rajeev-kumar-sharma/stopwatch
- Homepage: https://github.com/rajeev-kumar-sharma/stopwatch#readme
- Issues: https://github.com/rajeev-kumar-sharma/stopwatch/issues
- npm.io page: https://npm.io/package/stopwatch.js

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) ^8.0.51

## Recent versions

- 1.1.1 (latest) — 2017-11-19
- 1.1.0 — 2017-11-19
- 1.0.5 — 2017-11-19
- 1.0.3 — 2017-11-19
- 1.0.2 — 2017-11-19
- 1.0.1 — 2017-11-19
- 1.0.0 — 2017-11-12

## README

# stopwatch.js
JavaScript stopwatch

## Installation

##### In node:

```cmd
npm install stopwatch.js --save
```

### Usage

##### - typescript

```javascript
import { Stopwatch } from 'stopwatch.js'

// string output
const stopwatch = new Stopwatch();

stopwatch.start((time) => console.log(time)); // 00:00:01:95, 00:00:02:00, 00:00:02:15, ...

stopwatch.stop();

stopwatch.reset();

stopwatch.lap(); // 00:00:02:95
```

```javascript
import { Stopwatch, Output } from 'stopwatch.js'

// array output
const stopwatch = new Stopwatch(Output.Array);

stopwatch.start((time) => console.log(time)); // ['00', '00', '01', '95'], ['00', '00', '02', '00'], ['00', '00', '02', '15'], ...

stopwatch.stop();

stopwatch.reset();

stopwatch.lap(); // ['00', '00', '02', '95']
```

##### - javascript

```javascript
const stopwatchJs = require('stopwatch.js').Stopwatch;

const stopwatch = new Stopwatch();
```

```javascript
const stopwatchJs = require('stopwatch.js').Stopwatch;
const output = require('stopwatch.js').Output;

const stopwatch = new stopwatchJs(output.Array);
```


##### In browser:

```cmd
bower install stopwatch.js --save
```

```html
<script src="https://cdn.jsdelivr.net/npm/stopwatch.js@1.1.0/dist/stopwatch.min.js"></script>
```

### Usage

```javascript
var output = stopwatchJs.Output;
var stopwatch = new stopwatchJs.Stopwatch();

stopwatch.start(function(time) {
  // do something with time
})
```

Author
------
* Rajeev Sharma

License:
--------

MIT License

Copyright (c) 2017 Rajeev Sharma

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