# fast-date

> Fast UTC Date Timestamps

Latest version **3.0.3** (published 2019-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-date
pnpm add fast-date
yarn add fast-date
bun add fast-date
```

## 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 | 3.0.3 |
| Published | 2019-04-15 |
| First published | 2017-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | David Mark Clements |
| Maintainers | davidmarkclements |
| Keywords | date, fast, performant, performance, time |

## Links

- npm: https://www.npmjs.com/package/fast-date
- Repository: https://github.com/davidmarkclements/fast-date
- Homepage: https://github.com/davidmarkclements/fast-date#readme
- Issues: https://github.com/davidmarkclements/fast-date/issues
- npm.io page: https://npm.io/package/fast-date

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

- 3.0.3 (latest) — 2019-04-15
- 3.0.2 — 2018-05-25
- 3.0.1 — 2018-05-14
- 3.0.0 — 2018-05-14
- 2.0.0 — 2018-05-14
- 1.0.3 — 2018-05-12
- 1.0.2 — 2017-03-07
- 1.0.1 — 2017-03-07
- 1.0.0 — 2017-03-07

## README

# fast-date

[![Build Status](https://travis-ci.org/davidmarkclements/fast-date.svg?branch=master)](https://travis-ci.org/davidmarkclements/fast-date)
[![codecov](https://codecov.io/gh/davidmarkclements/fast-date/branch/master/graph/badge.svg)](https://codecov.io/gh/davidmarkclements/fast-date)


High Speed UTC Timestamps 

## Supports

- [x] Node 6
- [x] Node 8
- [x] Node 10

## Benchmarks

```sh
npm run bench
```

```
NativeDate*100000: 175.776ms
FastDateUnix*100000: 98.684ms
FastDateUtc*100000: 96.166ms
DateNow*100000: 107.326ms
TimerNow*100000: 105.762ms
```

`fast-date` is about as fast at providing UTC timestamps as `Date.now` is at providing millisecond epochs.

## Usage

```js
var fastDate = require('fast-date')()
var http = require('http')

http.createServer(function (req, res) {
  res.end(fastDate())
}).listen(8080)
```

### Options

#### format

Set the output, current options:

* `utc` output a UTC timestamp 
* `unix` output seconds since the unix Epoch

```js
var fastDate = require('fast-date')({format: 'unix'})
```

#### prefix & suffix

Add strings before and after:

```js
var fastDate = require('fast-date')({prefix: 'some text before', suffix: 'some text after'})
```

## Tests

```sh
npm test
```

## Coverage

```sh
npm run cov 
```

```
----------|----------|----------|----------|----------|----------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files |      100 |      100 |      100 |      100 |                |
 index.js |      100 |      100 |      100 |      100 |                |
----------|----------|----------|----------|----------|----------------|
```

## More Benchmarks

For effects on an HTTP server:

```sh
npm run bench-http
```

## License

MIT

## Acknowledgements

Sponsored by [nearForm](http://nearform.com)

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