Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

📆 Wrapper for Adam Greenough's CurrentYear API. 100% compatibility on Node and the browser

License

Notifications You must be signed in to change notification settings

arlopezg/currentyear-api-wrapper

Repository files navigation

CurrentYear API wrapper

npm coverage report bundle size

Get the current year for either UTC or specific timezone(s).


Getting started

NPM

npm i currentyear-api-wrapper@latest

CDN (no installation required)

<script src="https://unpkg.com/currentyear-api-wrapper"></script>

Usage

You will most likely be using the CurrentYearService which you can import as:

import { CurrentYearService } from "currentyear-api-wrapper";

const service = new CurrentYearService();
service.getCurrentYear("America/New_York").then(console.log); // e.g. "2022"

Reference


In the words of the wise Adam Greenough,

Where is the NPM package?

Don't tempt me.

Well, I was tempted.