Socket
Socket
Sign inDemoInstall

holidays-jp

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

holidays-jp

get Japanese public holidays


Version published
Weekly downloads
17
decreased by-63.83%
Maintainers
1
Weekly downloads
 
Created
Source

holidays-jp.js

test update npm version Try holidays-jp on RunKit renovate

get Japanese public holidays

Installation

npm

$ npm install holidays-jp

yarn

$ yarn add holidays-jp

Usage

const holidays = require('holidays-jp');

Example

const date = new Date(2019, 1 - 1, 1, 0, 0, 0, 0);

holidays.isHoliday(date); // => true
const date = new Date(2019, 1 - 1, 1, 0, 0, 0, 0);

holidays.getHolidayInfo(date); // => { date: '2019-01-01', name: '元日', ... }

Functions

see documents

CLI

holidays-jp.js has CLI command:

$ npx holidays-jp '2019-01-01T00:00:00+09:00'
$ echo $?
0
$ npx holidays-jp '2019-01-02T00:00:00+09:00'
$ echo $?
1

use current time if don't pass argument:

$ date +%FT%T
2019-08-25T03:09:59
$ npx holidays-jp
$ echo $?
1

holidays data

holidays-jp.js has some format holidays data, it converted from syukujitsu.csv:

const fs = require('fs');

const js = require('holidays-jp/data.js');
const json = require('holidays-jp/data.json');

const csv = fs.readFileSync(require.resolve('holidays-jp/data.csv'), 'utf8');
const tsv = fs.readFileSync(require.resolve('holidays-jp/data.tsv'), 'utf8');
const ltsv = fs.readFileSync(require.resolve('holidays-jp/data.ltsv'), 'utf8');
import data from 'holidays-jp/data.mjs';
import data from 'holidays-jp/data.ts';

「国民の祝日」について

License

The MIT license.

FAQs

Package last updated on 18 Sep 2019

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