Skip to content

Névnap is a minimalist JavaScript library that displays hungarian namedays.

License

Notifications You must be signed in to change notification settings

nevadavid/nevnap

Repository files navigation

Névnap

Nevnap (névnap) is a minimalist JavaScript library that displays hungarian namedays.

  • 🔌 No dependencies
  • ↔️ No XHR
  • 📦 Only 13.9kB (including names)

The names used in this package are from Wikipedia.

Installation

npm i nevnap

or

yarn add nevnap

Browser (UMD)

<!-- CDN example (unpkg) -->
<script src="https://unpkg.com/nevnap@latest"></script>

<script>
nevnap.today();
</script>

API

Methods

today(): string[]

Getting today's nameday(s).

import { today } from 'nevnap';

today(); // ['Zsuzsanna', 'Eliza', 'Konrád']

tomorrow(): string[]

Getting tomorrow's nameday(s).

import { tomorrow } from 'nevnap';

tomorrow(); // ['Aladár', 'Álmos', 'Leó']

on(date: string): string[]

Getting nameday(s) on a specific date.

import { on } from 'nevnap';

on('04-22'); // ['Csilla', 'Noémi', 'Kájusz', 'Noé']

to(name: string): string[]

Getting date(s) to a specific name.

import { to } from 'nevnap';

to('Csilla'); // ['04-22', '08-10']