Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
nordic-holidays
Advanced tools
This library provides functions to check and retrieve public holidays for Sweden (SE), Denmark (DK), and Norway (NO). It supports both fixed and moveable holidays, including those based on Easter.
This library provides functions to check and retrieve public holidays for Sweden (SE), Denmark (DK), and Norway (NO). It supports both fixed and moveable holidays, including those based on Easter.
To use this library in your project, first install it via npm:
npm install nordic-holidays
https://www.npmjs.com/package/nordic-holidays
const { checkHoliday, getHolidays } = require("nordic-holidays");
or
import { checkHoliday, getHolidays } from "nordic-holidays";
const date = '2024-12-25' or new Date('2024-12-25')
const countryCode = 'se' or 'dk' or 'no'
const language = 'english' or default 'local'
const holidayName = checkHoliday(date, countryCode, language) // Returns: "Juldagen"
const invalidHolidayDate = checkHoliday('2024-12-03', 'se') // Returns empty string: ""
const year = 2024
const holidays = getHolidays(year, countryCode, language) // Returns the following object:
{
"New Year's Day": '2024-01-01',
'Christmas Eve': '2024-12-24',
'Christmas Day': '2024-12-25',
'Second Day of Christmas': '2024-12-26',
"New Year's Eve": '2024-12-31',
"International Workers' Day": '2024-05-01',
Epiphany: '2024-01-06',
'National Day of Sweden': '2024-06-06',
'Good Friday': '2024-03-29',
'Easter Sunday': '2024-03-31',
'Easter Monday': '2024-04-01',
'Ascension Day': '2024-05-09',
Pentecost: '2024-05-19',
"All Saints' Day": '2024-11-02',
"Midsummer's Day": '2024-06-22'
}
checkHoliday(date: string | Date, country: "se" | "dk" | "no", language: 'english' | 'local'): string
getHolidays(year: number, country: "se" | "dk" | "no", language: 'english' | 'local'): string[]
FAQs
This library provides functions to check and retrieve public holidays for Sweden (SE), Denmark (DK), and Norway (NO). It supports both fixed and moveable holidays, including those based on Easter.
The npm package nordic-holidays receives a total of 3 weekly downloads. As such, nordic-holidays popularity was classified as not popular.
We found that nordic-holidays demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.