Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nz-public-holidays

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nz-public-holidays

Gets New Zealand public holiday details from a government .ical

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to nz-public-holidays

Documentation Maintenance License: MIT

Produces dates and details for New Zealand public holidays. Uses this government .iCal as source. If this changes, please raise an issue.

Install

npm install nz-public-holidays

Usage

const holidays = require('nz-public-holidays');

holidays((error, holidays) => {
    if (error) return console.error(error);
    console.log(...holidays.map((holiday) => {
      const { date, name, region, category, observedByWeekendWorker } = holiday;
      return `UPDATE tablename SET [HolidayName] = '${category}'` +
        `, [IsHoliday] = 1 WHERE [Date] = '${date}'`;
    }));
});

// OR

(async () => {
  const holidays = await holidays();
  console.log(...holidays.map((holiday) => {
      const { date, name, region, category, observedByWeekendWorker } = holiday;
      return `UPDATE tablename SET [HolidayName] = '${category}'` +
        `, [IsHoliday] = 1 WHERE [Date] = '${date}'`;
  }));
})();

Response Schema

Column nameTypeDescription
datestringDate of holiday YYYY-MM-DD
namestringRaw name of holiday
regionstringName of applicable region
categorystringStandardised name of holiday
observedByWeekendWorkerbooleanIf holiday is observed exclusively by weekend workers

Regions

Northland, Auckland, Taranaki, Hawke's Bay, Wellington, Marlborough, Nelson, Buller, South Canterbury, Canterbury, Westland, Otago, Southland, Chatham Islands, All

Categories

New Year's Day, Day after New Year's Day, Waitangi Day, Good Friday, Easter Monday, ANZAC Day, Queen's Birthday, Labour Day, Christmas Day, Boxing Day, Anniversary (Region)

Author

Tomas van der Wel

License

Copyright © 2019 Tomas van der Wel.
This project is MIT licensed.

Keywords

FAQs

Package last updated on 17 Apr 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc