Socket
Socket
Sign inDemoInstall

nyse-holidays

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nyse-holidays

Get all NYSE markets observe U.S. holidays


Version published
Weekly downloads
504
increased by66.34%
Maintainers
1
Install size
662 kB
Created
Weekly downloads
 

Readme

Source

nyse-holidays

Get all NYSE markets observe U.S. holidays since 1885

npm version Node.js CI codecov Known Vulnerabilities FOSSA Status

Installation

yarn add nyse-holidays

Usage

import { isHoliday, getHolidays } from "nyse-holidays";

console.log(isHoliday(new Date("2021-01-01"))); // true

console.log(isHoliday(new Date("2022-01-01"))); // false

console.log(getHolidays(2021));
/*
[
  {
    name: 'New Years Day',
    date: 2020-12-31T16:00:00.000Z,
    dateString: '2021-01-01'
  },
  {
    name: 'Martin Luther King, Jr. Day',
    date: 2021-01-17T16:00:00.000Z,
    dateString: '2021-01-18'
  },
  {
    name: "Washington's Birthday",
    date: 2021-02-14T16:00:00.000Z,
    dateString: '2021-02-15'
  },
  {
    name: 'Good Friday',
    date: 2021-04-01T16:00:00.000Z,
    dateString: '2021-04-02'
  },
  {
    name: 'Memorial Day',
    date: 2021-05-30T16:00:00.000Z,
    dateString: '2021-05-31'
  },
  {
    name: 'Independence Day',
    date: 2021-07-04T16:00:00.000Z,
    dateString: '2021-07-05'
  },
  {
    name: 'Labor Day',
    date: 2021-09-05T16:00:00.000Z,
    dateString: '2021-09-06'
  },
  {
    name: 'Thanksgiving Day',
    date: 2021-11-24T16:00:00.000Z,
    dateString: '2021-11-25'
  },
  {
    name: 'Christmas Day',
    date: 2021-12-23T16:00:00.000Z,
    dateString: '2021-12-24'
  }
]
*/

CodeSandbox

References

License

FOSSA Status

Keywords

FAQs

Last updated on 11 May 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc