Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 2.63 KB

README.md

File metadata and controls

60 lines (46 loc) · 2.63 KB

OnThisDay.js

Repo Banner for OnThisDay.js - JavaScript Library

Show your support!

OnThisDay.js is a JavaScript library for fetching events on specific dates from Wikipedia. It allows you to retrieve historical events, births, and deaths that occurred on the current or a particular date.

Example and usage

How to use OnThisDay.js:

import { OnThisDay } from 'https://cdn.jsdelivr.net/gh/MarketingPipeline/OnThisDay.js@latest/dist/onthisday.min.js';

// Fetch events, births, and deaths for a specific date
try {
    let onDate = await OnThisDay('July 4')
    console.log('All Data:', onDate.getAll());
    console.log('Births:', onDate.getBirths());
    console.log('Deaths:', onDate.getDeaths());
    console.log('Events:', onDate.getEvents());
} catch (error) {
    console.log(error.message)
}

// Fetch events, births, and deaths that happened on the current date.
try {
    let onToday = await OnThisDay()
    console.log('All Data:', onToday.getAll());
    console.log('Births:', onToday.getBirths());
    console.log('Deaths:', onToday.getDeaths());
    console.log('Events:', onToday.getEvents());
} catch (error) {
    console.log(error.message)
}

Contributing GitHub

Want to improve this? Create a pull request with detailed changes / improvements! If approved you will be added to the list of contributors of this awesome project!

See also the list of contributors who participate in this project.

License GitHub

This library is open-source and available under the MIT License. See the LICENSE file for more details.