# leap-year

> Check if a year is a leap year

Latest version **4.0.0** (published 2021-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install leap-year
pnpm add leap-year
yarn add leap-year
bun add leap-year
```

## Health

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

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-04-07 |
| First published | 2014-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/leap-year) |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | leap, year, date |

## Links

- npm: https://www.npmjs.com/package/leap-year
- Repository: https://github.com/sindresorhus/leap-year
- Homepage: https://github.com/sindresorhus/leap-year#readme
- Issues: https://github.com/sindresorhus/leap-year/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/leap-year

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

- 4.0.0 (latest) — 2021-04-07
- 3.0.0 — 2019-04-21
- 2.0.1 — 2016-12-17
- 2.0.0 — 2016-12-17
- 1.0.0 — 2014-08-13
- 0.1.0 — 2014-06-26

## README

# leap-year

> Check if a year is a [leap year](https://en.wikipedia.org/wiki/Leap_year)

## Install

```
$ npm install leap-year
```

## Usage

```js
import isLeapYear from 'leap-year';

isLeapYear(2014);
//=> false

isLeapYear(2016);
//=> true
```

## API

### isLeapYear(year?)

#### year

Type: `number`\
Default: Current year

### isLeapYear(date?)

#### date

Type: `Date`
Default: `new Date()`

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