### Install holiday-event-indonesia via npm Source: https://github.com/johnylie/holiday-event-indonesia/blob/main/README.md Install the package using npm with the --save flag. ```bash npm install holiday-event-indonesia --save ``` -------------------------------- ### Example response JSON Source: https://github.com/johnylie/holiday-event-indonesia/blob/main/README.md An example of the JSON response returned by getHolidays, showing a holiday entry with fields is_cuti, keterangan, and tanggal. ```json [ { "is_cuti": false, "keterangan": "Tahun Baru 2022", "tanggal": "2022-01-1" } ] ``` -------------------------------- ### Usage example: getHolidays function Source: https://github.com/johnylie/holiday-event-indonesia/blob/main/README.md Import getHolidays and fetch holidays for October 2024. The function returns a Promise that resolves to a HolidayResponse object. Errors are caught and logged. ```tsx import { getHolidays } from "holiday-event-indonesia"; const fetchHolidays = async () => { try { const holidays = await getHolidays(2024, 10); // Fetch holidays for October 2024 console.log(holidays); // Output the holiday data } catch (error) { console.error("Error fetching holidays:", error); } }; fetchHolidays(); ``` -------------------------------- ### API signature: getHolidays Source: https://github.com/johnylie/holiday-event-indonesia/blob/main/README.md The function signature for getHolidays. Both parameters are optional. ```tsx getHolidays(year?: number, month?: number): Promise ``` -------------------------------- ### getHolidays(year?, month?) Source: https://github.com/johnylie/holiday-event-indonesia/blob/main/README.md Retrieves holiday events in Indonesia for the specified year and month. Returns a Promise that resolves to an array of holiday objects with date, name, and description fields. ```APIDOC ## getHolidays(year?, month?) ### Description Retrieves holiday events in Indonesia for the specified year and month. Returns a Promise that resolves to an array of holiday objects with date, name, and description fields. ### Method Function call ### Signature ```tsx getHolidays(year?: number, month?: number): Promise ``` ### Parameters - **year** (number, optional) - The year for which to fetch holidays. - **month** (number, optional) - The month for which to fetch holidays. ### Return A Promise that resolves to a HolidayResponse object containing an array of holidays for the specified year and month. ### Response Example ```json [ { "is_cuti": false, "keterangan": "Tahun Baru 2022", "tanggal": "2022-01-1" } ] ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.