# present

> High-res timestamps in Node and browser

Latest version **1.0.0** (published 2016-04-12) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-04-12 |
| First published | 2014-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Dan Kaplun |
| Maintainers | dbkaplun |
| Keywords | time, timestamp, high-res, high-resolution, nanosecond, millisecond, performance, now |

## Links

- npm: https://www.npmjs.com/package/present
- Repository: https://github.com/dbkaplun/present
- Homepage: https://github.com/dbkaplun/present#readme
- Issues: https://github.com/dbkaplun/present/issues
- npm.io page: https://npm.io/package/present

## 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.0 (latest) — 2016-04-12
- 0.0.6 — 2014-05-04
- 0.0.5 — 2014-05-04
- 0.0.4 — 2014-04-05
- 0.0.3 — 2014-04-05
- 0.0.2 — 2014-04-04

## README

present [![present on npm](https://img.shields.io/npm/dm/present.svg?maxAge=2592000)](https://www.npmjs.com/package/present) [![build status](https://img.shields.io/travis/dbkaplun/present.svg?maxAge=2592000)](https://travis-ci.org/dbkaplun/present)
=======

High-res timestamps in Node and browser

Installation
------------

In Node: `npm install present`

In browser:

1. Copy `present.js` or `present.min.js` (with optional source map at `present.min.js.map`)
2. `<script src="path/to/present.{min.}js"></script>`
3. `performance.now` is automatically polyfilled -- if this is undesired, `present.noConflict();`

Usage
-----
_Node only:_ `var present = require('present');`

### `present()`

Returns a timestamp in milliseconds. In node, this uses `process.hrtime`. In the browser, the following are attempted (in order):

* `performance.now()`
* `performance.webkitNow()`
* `performance.msNow()`
* `performance.mozNow()`
* `performance.oNow()`
* `Date.now()`
* `new Date().getTime()`

### `present.noConflict()`
_Browser only._ Resets `performance.now` to what it was before `present` was included or `present.conflict` was called.

### `present.conflict()`
_Browser only._ Polyfills `performance.now`.

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