@ultirequiem/leap-year
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

leap-year

CI codecov deno doc

Custom badge Custom badge Custom badge

Check if a year is a leap year.

Usage

Deno 🚀

import { isLeapYear } from "https://deno.land/x/leap_year/mod.ts";

isLeapYear(2014); //=> false
isLeapYear(2016); //=> true
isLeapYear("6 October 2006 00:07:00 GMT"); //=> false
isLeapYear("2000"); //=> false
isLeapYear(new Date(2016, 1, 1)); //=> true
isLeapYear("13 December 400 00:07:00 GMT", true); //=> { year: 400, result: true }

Node.js 🐢

import { isLeapYear } from "@ultirequiem/leap-year";

Browser 🕸

You can use any CDN that you like.

Eg. ESM SkyPack / script tag JSDelivr.

The API is the same on all this platforms.

API

Autogenerated Documentation 🚀

CLI Tool

Was done mainly as usage example.

Install

  • Node.js 🦍
npm install -g @ultirequiem/leap-year
  • Deno 🦕
deno install https://deno.land/x/leap_year/leap-year.ts

Usage

leap-year "13 October 2020 00:07:00 GMT" 400 345
true
true
false

Or with the verbose flag 👇

leap-year "13 October 2020 00:07:00 GMT" 400 345 --verbose # -v
2020 is a leap year.
400 is a leap year.
345 is not a leap year.

Related

Support

Open an Issue, I will check it a soon as possible 👀

If you want to hurry me up a bit send me a tweet 😆

Consider supporting me on Patreon if you like my work 🚀

Don't forget to start the repo

Licence

Licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i @ultirequiem/leap-year

Weekly Downloads

39

Version

2.1.0

License

MIT

Unpacked Size

36.6 kB

Total Files

26

Last publish

Collaborators

  • ultirequiem