Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sasaplus1/holidays-jp.js
get Japanese public holidays
https://github.com/sasaplus1/holidays-jp.js
holidays javascript library
Last synced: 2 months ago
JSON representation
get Japanese public holidays
- Host: GitHub
- URL: https://github.com/sasaplus1/holidays-jp.js
- Owner: sasaplus1
- License: mit
- Created: 2019-08-16T05:58:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T01:52:55.000Z (8 months ago)
- Last Synced: 2024-05-29T15:41:34.791Z (8 months ago)
- Topics: holidays, javascript, library
- Language: TypeScript
- Homepage:
- Size: 688 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
# holidays-jp.js
[![test](https://github.com/sasaplus1/holidays-jp.js/workflows/test/badge.svg)](https://github.com/sasaplus1/holidays-jp.js/actions?query=workflow%3Atest)
[![npm version](https://badge.fury.io/js/holidays-jp.svg)](https://badge.fury.io/js/holidays-jp)
[![Try holidays-jp on RunKit](https://badge.runkitcdn.com/holidays-jp.svg)](https://npm.runkit.com/holidays-jp)get Japanese public holidays
## Installation
### npm
```console
$ npm install holidays-jp
```### yarn
```console
$ yarn add holidays-jp
```## Usage
```js
const holidays = require('holidays-jp');
```### Example
```js
const date = new Date(2019, 1 - 1, 1, 0, 0, 0, 0);holidays.isHoliday(date); // => true
``````js
const date = new Date(2019, 1 - 1, 1, 0, 0, 0, 0);holidays.getHolidayInfo(date); // => { date: '2019-01-01', name: '元日', ... }
```### CLI
holidays-jp.js has CLI command:
```console
$ npx holidays-jp '2019-01-01T00:00:00+09:00'
$ echo $?
0
``````console
$ npx holidays-jp '2019-01-02T00:00:00+09:00'
$ echo $?
1
```use current time if don't pass argument:
```console
$ date +%FT%T
2019-08-25T03:09:59
$ npx holidays-jp
$ echo $?
1
```### Related
- [sasaplus1/japanese-public-holidays](https://github.com/sasaplus1/japanese-public-holidays)
## License
The MIT license.