@hyunbinseo/holidays-kr 3.2027.0 → 4.2026.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,96 +6,101 @@
6
6
  - `CSV`, `JSON`, `ICS`, 캘린더 구독도 제공됩니다. [링크](https://github.com/hyunbinseo/holidays-kr#readme)
7
7
 
8
8
  ```js
9
- // 최근 2개년도의 공휴일 정보가 들어있습니다.
10
- // 예를 들어 v3.2025 버전으로 2024-2025년의 날짜를 확인할 수 있습니다.
9
+ // 요청한 연도의 공휴일 정보를 동적으로 불러옵니다.
11
10
  import { getHolidayNames, isHoliday } from '@hyunbinseo/holidays-kr';
12
11
 
13
12
  // 공휴일 여부
14
- isHoliday(new Date('2025-01-01T00:00:00+0900')); // true
15
- isHoliday(new Date('2025-01-02T00:00:00+0900')); // false
16
- isHoliday(new Date('2023-01-01T00:00:00+0900')); // RangeError
13
+ await isHoliday(new Date('2026-01-01T00:00:00+0900')); // true
14
+ await isHoliday(new Date('2026-01-02T00:00:00+0900')); // false
15
+ await isHoliday(new Date('2999-01-01T00:00:00+0900')); // RangeError
17
16
 
18
17
  // 공휴일 명칭(들)
19
- getHolidayNames(new Date('2025-05-05T00:00:00+0900')); // [ '어린이날', '부처님 오신 날' ]
20
- getHolidayNames(new Date('2025-05-04T00:00:00+0900')); // null
18
+ await getHolidayNames(new Date('2026-05-05T00:00:00+0900')); // ['어린이날']
19
+ await getHolidayNames(new Date('2026-05-04T00:00:00+0900')); // null
21
20
  ```
22
21
 
23
- <!-- Importing from jsDelivr, etc. is not recommended. -->
24
- <!-- Use bundlers to tree-shake unused holiday presets. -->
22
+ ```js
23
+ // 연도별 공휴일 정보를 정적으로 불러옵니다.
24
+ import { y2026 } from '@hyunbinseo/holidays-kr';
25
+ ```
26
+
27
+ ```jsonc
28
+ // y2026의 형태:
29
+ {
30
+ "2026-01-01": ["1월 1일"],
31
+ // ...
32
+ "2026-12-25": ["기독탄신일"],
33
+ }
34
+ ```
25
35
 
26
36
  ---
27
37
 
28
38
  ## Usage
29
39
 
30
- Based on the latest release. [migration guide](#migration)
31
-
32
- ```js
33
- // ESM and CJS are both supported.
34
- import { y2025 } from '@hyunbinseo/holidays-kr';
35
- const { y2025 } = require('@hyunbinseo/holidays-kr');
36
- ```
37
-
38
- Check if a date string is a holiday:
40
+ Check if a `yyyy-mm-dd` date string is a holiday:
39
41
 
40
42
  ```js
41
- import { y2024, y2025 } from '@hyunbinseo/holidays-kr';
43
+ import { y2026 } from '@hyunbinseo/holidays-kr';
42
44
 
43
- '2025-01-01' in y2025; // true
44
- '2025-01-02' in y2025; // false
45
-
46
- '2024-01-01' in y2025; // false
47
- '2024-01-01' in y2024; // true
45
+ '2026-01-01' in y2026; // true
46
+ '2026-01-02' in y2026; // false
47
+ '2025-01-01' in y2026; // false - different year
48
48
  ```
49
49
 
50
50
  ```jsonc
51
- // y2025 is shaped like this:
51
+ // y2026 is shaped like this:
52
52
  {
53
- "2025-01-01": ["1월 1일"],
54
- "2025-01-28": ["설날 전날"],
53
+ "2026-01-01": ["1월 1일"],
55
54
  // ...
56
- "2025-12-25": ["기독탄신일"],
55
+ "2026-12-25": ["기독탄신일"],
57
56
  }
58
57
  ```
59
58
 
60
59
  Check if a JavaScript Date is a holiday:
61
60
 
62
61
  ```js
63
- // Uses the latest 2 years of holiday data.
64
- // e.g. v3.2025 supports dates in the year 2024-2025
65
- // Supports tree-shaking: unused data is not bundled.
62
+ // Dynamically imports the preset for the requested year.
66
63
  import { isHoliday } from '@hyunbinseo/holidays-kr';
67
64
 
68
- // Jan 01 2025 00:00:00 GMT+0900 is a holiday in ROK.
69
- isHoliday(new Date('2025-01-01T00:00:00+0900')); // true
65
+ // Jan 01 2026 00:00:00 GMT+0900 is a holiday in ROK.
66
+ await isHoliday(new Date('2026-01-01T00:00:00+0900')); // true
70
67
 
71
68
  // Be cautious with the date's time zone!
72
- // Dec 31 2024 23:00:00 GMT+0900 is not a holiday in ROK.
73
- isHoliday(new Date('2025-01-01T00:00:00+1000')); // false
69
+ // Dec 31 2025 23:00:00 GMT+0900 is not a holiday in ROK.
70
+ await isHoliday(new Date('2026-01-01T00:00:00+1000')); // false
74
71
 
75
- // Throws RangeError in versions 3.2025 and above.
76
- isHoliday(new Date('2023-01-01T00:00:00+0900'));
72
+ // Throws RangeError if no preset exists for the year.
73
+ await isHoliday(new Date('2999-01-01T00:00:00+0900'));
77
74
  ```
78
75
 
76
+ Get holiday names of a given JavaScript Date:
77
+
79
78
  ```js
80
- // Trailing E stands for extended.
81
- // Uses holiday data from the year 2022.
82
- // e.g. v3.2025 supports dates in the year 2022-2025
83
- import { isHolidayE } from '@hyunbinseo/holidays-kr';
79
+ import { getHolidayNames } from '@hyunbinseo/holidays-kr';
84
80
 
85
- isHolidayE(new Date('2023-01-01T00:00:00+0900')); // true
81
+ await getHolidayNames(new Date('2026-05-05T00:00:00+0900')); // ['어린이날']
82
+ await getHolidayNames(new Date('2026-05-04T00:00:00+0900')); // null
86
83
  ```
87
84
 
88
- Get holiday names of a given JavaScript Date:
85
+ ## Migration
89
86
 
90
- ```js
91
- // Trailing E stands for extended. Same as above.
92
- import { getHolidayNames, getHolidayNamesE } from '@hyunbinseo/holidays-kr';
87
+ ### 4.x
93
88
 
94
- getHolidayNames(new Date('2025-05-05T00:00:00+0900')); // [ '어린이날', '부처님 오신 날' ]
95
- getHolidayNames(new Date('2025-05-04T00:00:00+0900')); // null
89
+ - `isHoliday` and `getHolidayNames` are now async
90
+ - `isHolidayE` and `getHolidayNamesE` are removed
91
+ - Holiday presets are dynamically imported per year
92
+
93
+ ```diff
94
+ - isHoliday(date);
95
+ - isHolidayE(date);
96
+ + await isHoliday(date);
96
97
  ```
97
98
 
98
- ## Migration
99
+ ```diff
100
+ - getHolidayNames(date);
101
+ - getHolidayNamesE(date);
102
+ + await getHolidayNames(date);
103
+ ```
99
104
 
100
105
  ### 3.x
101
106
 
@@ -0,0 +1,28 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2018.ts
3
+ var _2018_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2018,
5
+ y2018: () => y2018
6
+ });
7
+ const y2018 = {
8
+ "2018-01-01": ["1월 1일"],
9
+ "2018-02-15": ["설날 전날"],
10
+ "2018-02-16": ["설날"],
11
+ "2018-02-17": ["설날 다음 날"],
12
+ "2018-03-01": ["3ㆍ1절"],
13
+ "2018-05-05": ["어린이날"],
14
+ "2018-05-07": ["대체공휴일(어린이날)"],
15
+ "2018-05-22": ["부처님 오신 날"],
16
+ "2018-06-06": ["현충일"],
17
+ "2018-06-13": ["전국동시지방선거"],
18
+ "2018-08-15": ["광복절"],
19
+ "2018-09-23": ["추석 전날"],
20
+ "2018-09-24": ["추석"],
21
+ "2018-09-25": ["추석 다음 날"],
22
+ "2018-09-26": ["대체공휴일(추석)"],
23
+ "2018-10-03": ["개천절"],
24
+ "2018-10-09": ["한글날"],
25
+ "2018-12-25": ["기독탄신일"]
26
+ };
27
+ //#endregion
28
+ export { y2018 as n, _2018_exports as t };
@@ -0,0 +1,26 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2019.ts
3
+ var _2019_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2019,
5
+ y2019: () => y2019
6
+ });
7
+ const y2019 = {
8
+ "2019-01-01": ["1월 1일"],
9
+ "2019-02-04": ["설날 전날"],
10
+ "2019-02-05": ["설날"],
11
+ "2019-02-06": ["설날 다음 날"],
12
+ "2019-03-01": ["3ㆍ1절"],
13
+ "2019-05-05": ["어린이날"],
14
+ "2019-05-06": ["대체공휴일(어린이날)"],
15
+ "2019-05-12": ["부처님 오신 날"],
16
+ "2019-06-06": ["현충일"],
17
+ "2019-08-15": ["광복절"],
18
+ "2019-09-12": ["추석 전날"],
19
+ "2019-09-13": ["추석"],
20
+ "2019-09-14": ["추석 다음 날"],
21
+ "2019-10-03": ["개천절"],
22
+ "2019-10-09": ["한글날"],
23
+ "2019-12-25": ["기독탄신일"]
24
+ };
25
+ //#endregion
26
+ export { y2019 as n, _2019_exports as t };
@@ -0,0 +1,28 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2020.ts
3
+ var _2020_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2020,
5
+ y2020: () => y2020
6
+ });
7
+ const y2020 = {
8
+ "2020-01-01": ["1월 1일"],
9
+ "2020-01-24": ["설날 전날"],
10
+ "2020-01-25": ["설날"],
11
+ "2020-01-26": ["설날 다음 날"],
12
+ "2020-01-27": ["대체공휴일(설날)"],
13
+ "2020-03-01": ["3ㆍ1절"],
14
+ "2020-04-15": ["제21대 국회의원선거"],
15
+ "2020-04-30": ["부처님 오신 날"],
16
+ "2020-05-05": ["어린이날"],
17
+ "2020-06-06": ["현충일"],
18
+ "2020-08-15": ["광복절"],
19
+ "2020-08-17": ["임시공휴일"],
20
+ "2020-09-30": ["추석 전날"],
21
+ "2020-10-01": ["추석"],
22
+ "2020-10-02": ["추석 다음 날"],
23
+ "2020-10-03": ["개천절"],
24
+ "2020-10-09": ["한글날"],
25
+ "2020-12-25": ["기독탄신일"]
26
+ };
27
+ //#endregion
28
+ export { y2020 as n, _2020_exports as t };
@@ -0,0 +1,28 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2021.ts
3
+ var _2021_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2021,
5
+ y2021: () => y2021
6
+ });
7
+ const y2021 = {
8
+ "2021-01-01": ["1월 1일"],
9
+ "2021-02-11": ["설날 전날"],
10
+ "2021-02-12": ["설날"],
11
+ "2021-02-13": ["설날 다음 날"],
12
+ "2021-03-01": ["3ㆍ1절"],
13
+ "2021-05-05": ["어린이날"],
14
+ "2021-05-19": ["부처님 오신 날"],
15
+ "2021-06-06": ["현충일"],
16
+ "2021-08-15": ["광복절"],
17
+ "2021-08-16": ["대체공휴일(광복절)"],
18
+ "2021-09-20": ["추석 전날"],
19
+ "2021-09-21": ["추석"],
20
+ "2021-09-22": ["추석 다음 날"],
21
+ "2021-10-03": ["개천절"],
22
+ "2021-10-04": ["대체공휴일(개천절)"],
23
+ "2021-10-09": ["한글날"],
24
+ "2021-10-11": ["대체공휴일(한글날)"],
25
+ "2021-12-25": ["기독탄신일"]
26
+ };
27
+ //#endregion
28
+ export { y2021 as n, _2021_exports as t };
@@ -0,0 +1,29 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2022.ts
3
+ var _2022_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2022,
5
+ y2022: () => y2022
6
+ });
7
+ const y2022 = {
8
+ "2022-01-01": ["1월 1일"],
9
+ "2022-01-31": ["설날 전날"],
10
+ "2022-02-01": ["설날"],
11
+ "2022-02-02": ["설날 다음 날"],
12
+ "2022-03-01": ["3ㆍ1절"],
13
+ "2022-03-09": ["대통령선거"],
14
+ "2022-05-05": ["어린이날"],
15
+ "2022-05-08": ["부처님 오신 날"],
16
+ "2022-06-01": ["전국동시지방선거"],
17
+ "2022-06-06": ["현충일"],
18
+ "2022-08-15": ["광복절"],
19
+ "2022-09-09": ["추석 전날"],
20
+ "2022-09-10": ["추석"],
21
+ "2022-09-11": ["추석 다음 날"],
22
+ "2022-09-12": ["대체공휴일(추석)"],
23
+ "2022-10-03": ["개천절"],
24
+ "2022-10-09": ["한글날"],
25
+ "2022-10-10": ["대체공휴일(한글날)"],
26
+ "2022-12-25": ["기독탄신일"]
27
+ };
28
+ //#endregion
29
+ export { y2022 as n, _2022_exports as t };
@@ -0,0 +1,28 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2023.ts
3
+ var _2023_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2023,
5
+ y2023: () => y2023
6
+ });
7
+ const y2023 = {
8
+ "2023-01-01": ["1월 1일"],
9
+ "2023-01-21": ["설날 전날"],
10
+ "2023-01-22": ["설날"],
11
+ "2023-01-23": ["설날 다음 날"],
12
+ "2023-01-24": ["대체공휴일(설날)"],
13
+ "2023-03-01": ["3ㆍ1절"],
14
+ "2023-05-05": ["어린이날"],
15
+ "2023-05-27": ["부처님 오신 날"],
16
+ "2023-05-29": ["대체공휴일(부처님 오신 날)"],
17
+ "2023-06-06": ["현충일"],
18
+ "2023-08-15": ["광복절"],
19
+ "2023-09-28": ["추석 전날"],
20
+ "2023-09-29": ["추석"],
21
+ "2023-09-30": ["추석 다음 날"],
22
+ "2023-10-02": ["임시공휴일"],
23
+ "2023-10-03": ["개천절"],
24
+ "2023-10-09": ["한글날"],
25
+ "2023-12-25": ["기독탄신일"]
26
+ };
27
+ //#endregion
28
+ export { y2023 as n, _2023_exports as t };
@@ -0,0 +1,29 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2024.ts
3
+ var _2024_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2024,
5
+ y2024: () => y2024
6
+ });
7
+ const y2024 = {
8
+ "2024-01-01": ["1월 1일"],
9
+ "2024-02-09": ["설날 전날"],
10
+ "2024-02-10": ["설날"],
11
+ "2024-02-11": ["설날 다음 날"],
12
+ "2024-02-12": ["대체공휴일(설날)"],
13
+ "2024-03-01": ["3ㆍ1절"],
14
+ "2024-04-10": ["제22대국회의원선거"],
15
+ "2024-05-05": ["어린이날"],
16
+ "2024-05-06": ["대체공휴일(어린이날)"],
17
+ "2024-05-15": ["부처님 오신 날"],
18
+ "2024-06-06": ["현충일"],
19
+ "2024-08-15": ["광복절"],
20
+ "2024-09-16": ["추석 전날"],
21
+ "2024-09-17": ["추석"],
22
+ "2024-09-18": ["추석 다음 날"],
23
+ "2024-10-01": ["임시공휴일"],
24
+ "2024-10-03": ["개천절"],
25
+ "2024-10-09": ["한글날"],
26
+ "2024-12-25": ["기독탄신일"]
27
+ };
28
+ //#endregion
29
+ export { y2024 as n, _2024_exports as t };
@@ -0,0 +1,29 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2025.ts
3
+ var _2025_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2025,
5
+ y2025: () => y2025
6
+ });
7
+ const y2025 = {
8
+ "2025-01-01": ["1월 1일"],
9
+ "2025-01-27": ["임시공휴일"],
10
+ "2025-01-28": ["설날 전날"],
11
+ "2025-01-29": ["설날"],
12
+ "2025-01-30": ["설날 다음 날"],
13
+ "2025-03-01": ["3ㆍ1절"],
14
+ "2025-03-03": ["대체공휴일(3ㆍ1절)"],
15
+ "2025-05-05": ["어린이날", "부처님 오신 날"],
16
+ "2025-05-06": ["대체공휴일(부처님 오신 날)"],
17
+ "2025-06-03": ["임시공휴일(대통령선거)"],
18
+ "2025-06-06": ["현충일"],
19
+ "2025-08-15": ["광복절"],
20
+ "2025-10-03": ["개천절"],
21
+ "2025-10-05": ["추석 전날"],
22
+ "2025-10-06": ["추석"],
23
+ "2025-10-07": ["추석 다음 날"],
24
+ "2025-10-08": ["대체공휴일(추석)"],
25
+ "2025-10-09": ["한글날"],
26
+ "2025-12-25": ["기독탄신일"]
27
+ };
28
+ //#endregion
29
+ export { y2025 as n, _2025_exports as t };
@@ -0,0 +1,32 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
+ //#region src/holidays/2026.ts
3
+ var _2026_exports = /* @__PURE__ */ __exportAll({
4
+ default: () => y2026,
5
+ y2026: () => y2026
6
+ });
7
+ const y2026 = {
8
+ "2026-01-01": ["1월 1일"],
9
+ "2026-02-16": ["설날 전날"],
10
+ "2026-02-17": ["설날"],
11
+ "2026-02-18": ["설날 다음 날"],
12
+ "2026-03-01": ["3ㆍ1절"],
13
+ "2026-03-02": ["대체공휴일(3ㆍ1절)"],
14
+ "2026-05-01": ["노동절"],
15
+ "2026-05-05": ["어린이날"],
16
+ "2026-05-24": ["부처님 오신 날"],
17
+ "2026-05-25": ["대체공휴일(부처님 오신 날)"],
18
+ "2026-06-03": ["전국동시지방선거"],
19
+ "2026-06-06": ["현충일"],
20
+ "2026-07-17": ["제헌절"],
21
+ "2026-08-15": ["광복절"],
22
+ "2026-08-17": ["대체공휴일(광복절)"],
23
+ "2026-09-24": ["추석 전날"],
24
+ "2026-09-25": ["추석"],
25
+ "2026-09-26": ["추석 다음 날"],
26
+ "2026-10-03": ["개천절"],
27
+ "2026-10-05": ["대체공휴일(개천절)"],
28
+ "2026-10-09": ["한글날"],
29
+ "2026-12-25": ["기독탄신일"]
30
+ };
31
+ //#endregion
32
+ export { y2026 as n, _2026_exports as t };
package/dist/index.d.ts CHANGED
@@ -201,38 +201,8 @@ declare const y2026: {
201
201
  readonly '2026-12-25': readonly ["기독탄신일"];
202
202
  };
203
203
  //#endregion
204
- //#region src/holidays/2027.d.ts
205
- declare const y2027: {
206
- readonly '2027-01-01': readonly ["1월 1일"];
207
- readonly '2027-02-06': readonly ["설날 전날"];
208
- readonly '2027-02-07': readonly ["설날"];
209
- readonly '2027-02-08': readonly ["설날 다음 날"];
210
- readonly '2027-02-09': readonly ["대체공휴일(설날)"];
211
- readonly '2027-03-01': readonly ["3ㆍ1절"];
212
- readonly '2027-05-01': readonly ["노동절"];
213
- readonly '2027-05-03': readonly ["대체공휴일(노동절)"];
214
- readonly '2027-05-05': readonly ["어린이날"];
215
- readonly '2027-05-13': readonly ["부처님 오신 날"];
216
- readonly '2027-06-06': readonly ["현충일"];
217
- readonly '2027-07-17': readonly ["제헌절"];
218
- readonly '2027-07-19': readonly ["대체공휴일(제헌절)"];
219
- readonly '2027-08-15': readonly ["광복절"];
220
- readonly '2027-08-16': readonly ["대체공휴일(광복절)"];
221
- readonly '2027-09-14': readonly ["추석 전날"];
222
- readonly '2027-09-15': readonly ["추석"];
223
- readonly '2027-09-16': readonly ["추석 다음 날"];
224
- readonly '2027-10-03': readonly ["개천절"];
225
- readonly '2027-10-04': readonly ["대체공휴일(개천절)"];
226
- readonly '2027-10-09': readonly ["한글날"];
227
- readonly '2027-10-11': readonly ["대체공휴일(한글날)"];
228
- readonly '2027-12-25': readonly ["기독탄신일"];
229
- readonly '2027-12-27': readonly ["대체공휴일(기독탄신일)"];
230
- };
231
- //#endregion
232
- //#region src/index.d.ts
233
- declare const getHolidayNames: (date: Date) => readonly string[] | null;
234
- declare const getHolidayNamesE: (date: Date) => readonly string[] | null;
235
- declare const isHoliday: (date: Date) => boolean;
236
- declare const isHolidayE: (date: Date) => boolean;
204
+ //#region src/holidays/utils.d.ts
205
+ declare const getHolidayNames: (date: Date) => Promise<readonly string[] | null>;
206
+ declare const isHoliday: (date: Date) => Promise<boolean>;
237
207
  //#endregion
238
- export { getHolidayNames, getHolidayNamesE, isHoliday, isHolidayE, y2018, y2019, y2020, y2021, y2022, y2023, y2024, y2025, y2026, y2027 };
208
+ export { getHolidayNames, isHoliday, y2018, y2019, y2020, y2021, y2022, y2023, y2024, y2025, y2026 };