# node-eta

> Estimated time to arrival

Latest version **0.9.0** (published 2015-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-eta
pnpm add node-eta
yarn add node-eta
bun add node-eta
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2015-11-27 |
| First published | 2014-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Constantin Titarenko |
| Maintainers | titarenko |
| Keywords | eta, estimated time to arrival, estimated, time, arrival |

## Links

- npm: https://www.npmjs.com/package/node-eta
- Repository: https://github.com/titarenko/eta
- Issues: https://github.com/titarenko/eta/issues
- npm.io page: https://npm.io/package/node-eta

## 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

- 0.9.0 (latest) — 2015-11-27
- 0.1.1 — 2014-06-26
- 0.1.0 — 2014-06-26

## README

# ETA

Estimated time to arrival.

## API

### ctor(count[, autoStartOrOptions])

Constructs ETA object for `count` of iterations. 
Optionally accepts additional parameter specifying whether time measurement should start immediately (autoStart), or, if it is an object, then it will be treated as options.

Options are:

- autoStart - already described
- numberFormatter - function, which accepts number and returns string

```js
var Eta = require('node-eta');
var eta = new Eta(10);
```

### start()

Starts time measurement.

### iterate([anything1, anything2, ...])

Notifies estimator that one more iteration has finished.
Optionally supports any number of arguments that will be passed to `util.format` to produce message, associated with last iteration.

### format([anything1, anything2, ...])

Passes arguments to `util.format` and treats its invocation result as layout where following placeholders can participate:

- `{{elapsed}}` - elapsed time in seconds
- `{{rate}}` - current rate (iterations per second)
- `{{estimated}}` - estimated time (total) in seconds
- `{{progress}}` - progress (fraction of 1)
- `{{eta}}` - estimated time to arrival in seconds
- `{{etah}}` - formatted (for human-readability) eta
- `{{last}}` - message from last iteration, if any

Returns layout filled with placeholder values.

## License

MIT

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