bg-name-days 2.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mariyan Yordanov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,190 @@
1
+ # bg-name-days
2
+
3
+ Bulgarian name days calendar library. Pure JavaScript, zero dependencies.
4
+ 800+ names with variants, diminutives, Latin transliteration, and moveable Orthodox feast date computation.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ npm install bg-name-days
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```js
15
+ import {
16
+ getNameDay,
17
+ getNamesByDate,
18
+ isNameDay,
19
+ getTodayNames,
20
+ searchNames,
21
+ getNamesByHoliday,
22
+ getUpcomingNameDays,
23
+ getAllNameDays,
24
+ transliterate,
25
+ orthodoxEaster,
26
+ } from 'bg-name-days';
27
+ ```
28
+
29
+ ### Find name day by name
30
+
31
+ ```js
32
+ getNameDay('Георги');
33
+ // {
34
+ // name: 'Георги', month: 5, day: 6,
35
+ // holiday: 'Гергьовден', holidayLatin: 'Gergyovden',
36
+ // tradition: 'orthodox', variants: ['Георгина', 'Гергана', ...],
37
+ // isMoveable: false
38
+ // }
39
+
40
+ getNameDay('Georgi'); // Latin input works too
41
+ getNameDay('гошо'); // Case-insensitive, finds via variants → Георги
42
+
43
+ getNameDay('Стефан');
44
+ // Returns array — Стефан has multiple name days (Jan 9 + Dec 27)
45
+
46
+ getNameDay('Непознато');
47
+ // null
48
+ ```
49
+
50
+ ### Get names by date
51
+
52
+ ```js
53
+ getNamesByDate('05-06');
54
+ // ['Георги', 'Георгина', 'Гергана', 'Гошо', 'Жоро', ...]
55
+
56
+ getNamesByDate(new Date(2026, 0, 1));
57
+ // ['Васил', 'Василка', 'Василена', ...]
58
+ ```
59
+
60
+ ### Check if today is someone's name day
61
+
62
+ ```js
63
+ isNameDay('Георги', new Date('2026-05-06')); // true
64
+ isNameDay('Георги', new Date('2026-05-07')); // false
65
+ isNameDay('Цветан', new Date('2026-04-05')); // true (Цветница 2026)
66
+ ```
67
+
68
+ ### Get today's celebrating names
69
+
70
+ ```js
71
+ getTodayNames();
72
+ // ['Валентин', 'Валентина', 'Трифон', ...] (on Feb 14)
73
+ ```
74
+
75
+ ### Search names by prefix
76
+
77
+ ```js
78
+ searchNames('Гео');
79
+ // [{ name: 'Георги', date: '05-06', holiday: 'Гергьовден' }]
80
+
81
+ searchNames('Geo'); // Latin prefix search works too
82
+ ```
83
+
84
+ ### Get names by holiday
85
+
86
+ ```js
87
+ getNamesByHoliday('Гергьовден');
88
+ // ['Георги', 'Георгина', 'Гергана', 'Гошо', 'Жоро', ...]
89
+
90
+ getNamesByHoliday('Цветница');
91
+ // 100+ flower-related names (Цветан, Роза, Виолета, Маргарита, ...)
92
+ ```
93
+
94
+ ### Upcoming name days
95
+
96
+ ```js
97
+ getUpcomingNameDays(7);
98
+ // [
99
+ // { month: 2, day: 14, holiday: 'Трифон Зарезан', names: ['Трифон', ...] },
100
+ // { month: 2, day: 17, holiday: '...', names: [...] },
101
+ // ...
102
+ // ]
103
+
104
+ getUpcomingNameDays(7, new Date('2026-05-01')); // Custom start date
105
+ ```
106
+
107
+ ### Transliterate
108
+
109
+ ```js
110
+ transliterate('Георги'); // 'Georgi'
111
+ transliterate('Yordan'); // 'Йордан'
112
+ transliterate('Щерьо'); // 'Shteryo'
113
+ ```
114
+
115
+ ### Orthodox Easter
116
+
117
+ ```js
118
+ orthodoxEaster(2026); // Date: April 12, 2026
119
+ orthodoxEaster(2027); // Date: May 2, 2027
120
+ ```
121
+
122
+ ### Get all name days
123
+
124
+ ```js
125
+ const all = getAllNameDays(2026);
126
+ // Array of 263 NameDayResult objects (fixed + resolved moveable for the year)
127
+ ```
128
+
129
+ ## API Reference
130
+
131
+ | Function | Parameters | Returns | Description |
132
+ |---|---|---|---|
133
+ | `getNameDay(name, year?)` | `string, number?` | `NameDayResult \| NameDayResult[] \| null` | Find name day by name (Cyrillic or Latin) |
134
+ | `getNamesByDate(date, year?)` | `string \| Date, number?` | `string[]` | Get all celebrating names for a date |
135
+ | `isNameDay(name, date)` | `string, Date` | `boolean` | Check if a name celebrates on a date |
136
+ | `getTodayNames()` | - | `string[]` | Get names celebrating today |
137
+ | `searchNames(prefix, year?)` | `string, number?` | `SearchResult[]` | Search names by prefix |
138
+ | `getNamesByHoliday(name, year?)` | `string, number?` | `string[]` | Get all names for a holiday |
139
+ | `getUpcomingNameDays(days, start?)` | `number, Date?` | `UpcomingNameDay[]` | Get upcoming name days |
140
+ | `getAllNameDays(year?)` | `number?` | `NameDayResult[]` | Get full dataset |
141
+ | `transliterate(text)` | `string` | `string` | Auto-detect and transliterate (CYR↔LAT) |
142
+ | `orthodoxEaster(year)` | `number` | `Date` | Calculate Orthodox Easter date |
143
+
144
+ ## Moveable Feasts
145
+
146
+ Seven Bulgarian name days are tied to moveable Orthodox feasts (based on Easter):
147
+
148
+ | Holiday | Offset | Example names |
149
+ |---|---|---|
150
+ | Тодоровден | Easter − 43 | Тодор, Теодор, Дора, Божидар |
151
+ | Лазаровден | Easter − 8 | Лазар, Лъчезар |
152
+ | Цветница | Easter − 7 | Цветан, Роза, Виолета, Маргарита, 100+ |
153
+ | Великден | Easter | Велика, Велико, Паскал |
154
+ | Спасовден | Easter + 39 | Спас, Спасена |
155
+ | Петдесетница | Easter + 49 | Трайко, Траян |
156
+ | Духов ден | Easter + 50 | Пламен |
157
+
158
+ The library automatically computes the correct dates for any year using the Gauss algorithm for Orthodox Easter.
159
+
160
+ ## Transliteration
161
+
162
+ Follows the official Bulgarian transliteration law (2009):
163
+
164
+ | А | Б | В | Г | Д | Е | Ж | З | И | Й | К | Л | М | Н | О |
165
+ |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
166
+ | A | B | V | G | D | E | Zh | Z | I | Y | K | L | M | N | O |
167
+
168
+ | П | Р | С | Т | У | Ф | Х | Ц | Ч | Ш | Щ | Ъ | Ь | Ю | Я |
169
+ |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
170
+ | P | R | S | T | U | F | H | Ts | Ch | Sh | Sht | A | Y | Yu | Ya |
171
+
172
+ ## Data Sources
173
+
174
+ - Bulgarian Orthodox Church calendar
175
+ - imeniden.com — comprehensive Bulgarian name day reference
176
+ - Wikipedia: Именни дни в България
177
+ - bg-patriarshia.bg — Patriarch's official calendar
178
+
179
+ ## Contributing Names
180
+
181
+ Know a Bulgarian name that's missing? PRs welcome!
182
+
183
+ 1. Find the correct month file in `src/data/` (e.g., `may.js` for May names)
184
+ 2. Add your entry following the format in existing files
185
+ 3. Run `npm test` to verify data integrity
186
+ 4. Submit PR with source reference
187
+
188
+ ## License
189
+
190
+ MIT
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "bg-name-days",
3
+ "version": "2.0.0",
4
+ "description": "Bulgarian name days calendar library. Pure JavaScript, zero dependencies. 800+ names with variants, diminutives, Latin transliteration, and moveable Orthodox feast date computation.",
5
+ "type": "module",
6
+ "main": "./src/index.js",
7
+ "exports": {
8
+ ".": "./src/index.js"
9
+ },
10
+ "scripts": {
11
+ "test": "node --test __tests__/*.test.js",
12
+ "validate": "node scripts/validateData.js"
13
+ },
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "keywords": [
18
+ "bulgarian",
19
+ "name-days",
20
+ "именни-дни",
21
+ "имен-ден",
22
+ "calendar",
23
+ "transliteration",
24
+ "bulgaria",
25
+ "orthodox",
26
+ "orthodox-easter"
27
+ ],
28
+ "author": "KinTales",
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/MariyanYordanov/kintales-name-days.git"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/MariyanYordanov/kintales-name-days/issues"
36
+ },
37
+ "homepage": "https://github.com/MariyanYordanov/kintales-name-days#readme",
38
+ "files": [
39
+ "src/"
40
+ ]
41
+ }
@@ -0,0 +1,135 @@
1
+ /** @typedef {import('../types.js').NameDayEntry} NameDayEntry */
2
+
3
+ /** @type {NameDayEntry[]} */
4
+ export const april = [
5
+ {
6
+ name: "Мария",
7
+ variants: ["Мариан", "Мариана", "Мариела", "Маринела", "Маринка", "Марика", "Мара", "Марийка", "Мариета", "Марио", "Марин", "Марина"],
8
+ latin: ["Mariya", "Marian", "Mariana", "Mariela", "Marinela", "Marinka", "Marika", "Mara", "Mariyka", "Marieta", "Mario", "Marin", "Marina"],
9
+ month: 4, day: 1,
10
+ holiday: "Света Мария Египетска",
11
+ holidayLatin: "Sveta Mariya Egipetska",
12
+ tradition: "orthodox",
13
+ moveable: null,
14
+ },
15
+ {
16
+ name: "Исидор",
17
+ variants: [],
18
+ latin: ["Isidor"],
19
+ month: 4, day: 4,
20
+ holiday: "Свети Исидор",
21
+ holidayLatin: "Sveti Isidor",
22
+ tradition: "orthodox",
23
+ moveable: null,
24
+ },
25
+ {
26
+ name: "Теодул",
27
+ variants: [],
28
+ latin: ["Teodul"],
29
+ month: 4, day: 5,
30
+ holiday: "Свети Теодул",
31
+ holidayLatin: "Sveti Teodul",
32
+ tradition: "orthodox",
33
+ moveable: null,
34
+ },
35
+ {
36
+ name: "Методи",
37
+ variants: ["Методий"],
38
+ latin: ["Metodi", "Metodiy"],
39
+ month: 4, day: 6,
40
+ holiday: "Свети Методий",
41
+ holidayLatin: "Sveti Metodiy",
42
+ tradition: "orthodox",
43
+ moveable: null,
44
+ },
45
+ {
46
+ name: "Мартин",
47
+ variants: ["Мартина"],
48
+ latin: ["Martin", "Martina"],
49
+ month: 4, day: 14,
50
+ holiday: "Свети Мартин",
51
+ holidayLatin: "Sveti Martin",
52
+ tradition: "orthodox",
53
+ moveable: null,
54
+ },
55
+ {
56
+ name: "Марко",
57
+ variants: ["Марк"],
58
+ latin: ["Marko", "Mark"],
59
+ month: 4, day: 25,
60
+ holiday: "Свети Марк",
61
+ holidayLatin: "Sveti Mark",
62
+ tradition: "orthodox",
63
+ moveable: null,
64
+ },
65
+ {
66
+ name: "Симеон",
67
+ variants: ["Симо", "Симона"],
68
+ latin: ["Simeon", "Simo", "Simona"],
69
+ month: 4, day: 17,
70
+ holiday: "Свети Симеон",
71
+ holidayLatin: "Sveti Simeon",
72
+ tradition: "orthodox",
73
+ moveable: null,
74
+ },
75
+ {
76
+ name: "Елисавета",
77
+ variants: ["Елиза"],
78
+ latin: ["Elisaveta", "Eliza"],
79
+ month: 4, day: 24,
80
+ holiday: "Света Елисавета",
81
+ holidayLatin: "Sveta Elisaveta",
82
+ tradition: "orthodox",
83
+ moveable: null,
84
+ },
85
+ {
86
+ name: "Никита",
87
+ variants: [],
88
+ latin: ["Nikita"],
89
+ month: 4, day: 3,
90
+ holiday: "Свети Никита",
91
+ holidayLatin: "Sveti Nikita",
92
+ tradition: "orthodox",
93
+ moveable: null,
94
+ },
95
+ {
96
+ name: "Терентий",
97
+ variants: [],
98
+ latin: ["Terentiy"],
99
+ month: 4, day: 10,
100
+ holiday: "Свети Терентий",
101
+ holidayLatin: "Sveti Terentiy",
102
+ tradition: "orthodox",
103
+ moveable: null,
104
+ },
105
+ {
106
+ name: "Яков",
107
+ variants: ["Якоб"],
108
+ latin: ["Yakov", "Yakob"],
109
+ month: 4, day: 30,
110
+ holiday: "Свети Яков",
111
+ holidayLatin: "Sveti Yakov",
112
+ tradition: "orthodox",
113
+ moveable: null,
114
+ },
115
+ {
116
+ name: "Теодосий",
117
+ variants: ["Тодосий", "Доси"],
118
+ latin: ["Teodosiy", "Todosiy", "Dosi"],
119
+ month: 4, day: 7,
120
+ holiday: "Свети Теодосий",
121
+ holidayLatin: "Sveti Teodosiy",
122
+ tradition: "orthodox",
123
+ moveable: null,
124
+ },
125
+ {
126
+ name: "Ирина",
127
+ variants: ["Ирена", "Ира"],
128
+ latin: ["Irina", "Irena", "Ira"],
129
+ month: 4, day: 16,
130
+ holiday: "Света Ирина",
131
+ holidayLatin: "Sveta Irina",
132
+ tradition: "orthodox",
133
+ moveable: null,
134
+ },
135
+ ];
@@ -0,0 +1,175 @@
1
+ /** @typedef {import('../types.js').NameDayEntry} NameDayEntry */
2
+
3
+ /** @type {NameDayEntry[]} */
4
+ export const august = [
5
+ {
6
+ name: "Макавей",
7
+ variants: [],
8
+ latin: ["Makavey"],
9
+ month: 8, day: 1,
10
+ holiday: "Свети Макавей",
11
+ holidayLatin: "Sveti Makavey",
12
+ tradition: "orthodox",
13
+ moveable: null,
14
+ },
15
+ {
16
+ name: "Преслав",
17
+ variants: ["Преслава", "Спас", "Спаска", "Спасена", "Спасиян"],
18
+ latin: ["Preslav", "Preslava", "Spas", "Spaska", "Spasena", "Spasiyan"],
19
+ month: 8, day: 6,
20
+ holiday: "Преображение Господне",
21
+ holidayLatin: "Preobrazhenie Gospodne",
22
+ tradition: "orthodox",
23
+ moveable: null,
24
+ },
25
+ {
26
+ name: "Дончо",
27
+ variants: ["Донка", "Доника"],
28
+ latin: ["Doncho", "Donka", "Donika"],
29
+ month: 8, day: 7,
30
+ holiday: "Свети Донат",
31
+ holidayLatin: "Sveti Donat",
32
+ tradition: "orthodox",
33
+ moveable: null,
34
+ },
35
+ {
36
+ name: "Емил",
37
+ variants: ["Емилия", "Емилиян", "Емилиана"],
38
+ latin: ["Emil", "Emiliya", "Emiliyan", "Emiliana"],
39
+ month: 8, day: 8,
40
+ holiday: "Свети Емилиан",
41
+ holidayLatin: "Sveti Emilian",
42
+ tradition: "orthodox",
43
+ moveable: null,
44
+ },
45
+ {
46
+ name: "Мария",
47
+ variants: ["Мариан", "Мариана", "Мариела", "Маринела", "Маринка", "Марика", "Мара", "Марийка", "Мариета", "Марио", "Богдана", "Божана"],
48
+ latin: ["Mariya", "Marian", "Mariana", "Mariela", "Marinela", "Marinka", "Marika", "Mara", "Mariyka", "Marieta", "Mario", "Bogdana", "Bozhana"],
49
+ month: 8, day: 15,
50
+ holiday: "Голяма Богородица",
51
+ holidayLatin: "Golyama Bogoroditsa",
52
+ tradition: "orthodox",
53
+ moveable: null,
54
+ },
55
+ {
56
+ name: "Самуил",
57
+ variants: ["Самуила"],
58
+ latin: ["Samuil", "Samuila"],
59
+ month: 8, day: 20,
60
+ holiday: "Свети Самуил",
61
+ holidayLatin: "Sveti Samuil",
62
+ tradition: "orthodox",
63
+ moveable: null,
64
+ },
65
+ {
66
+ name: "Адриан",
67
+ variants: ["Адриана", "Наталия", "Натали", "Наталка"],
68
+ latin: ["Adrian", "Adriana", "Nataliya", "Natali", "Natalka"],
69
+ month: 8, day: 26,
70
+ holiday: "Свети Адриан и Наталия",
71
+ holidayLatin: "Sveti Adrian i Nataliya",
72
+ tradition: "orthodox",
73
+ moveable: null,
74
+ },
75
+ {
76
+ name: "Фани",
77
+ variants: ["Фанка"],
78
+ latin: ["Fani", "Fanka"],
79
+ month: 8, day: 27,
80
+ holiday: "Свети Фанурий",
81
+ holidayLatin: "Sveti Fanuriy",
82
+ tradition: "orthodox",
83
+ moveable: null,
84
+ },
85
+ {
86
+ name: "Йоан",
87
+ variants: ["Йоана"],
88
+ latin: ["Yoan", "Yoana"],
89
+ month: 8, day: 28,
90
+ holiday: "Успение на Свети Йоан Кръстител",
91
+ holidayLatin: "Uspenie na Sveti Yoan Krastitel",
92
+ tradition: "orthodox",
93
+ moveable: null,
94
+ },
95
+ {
96
+ name: "Александър",
97
+ variants: ["Александра", "Александрина", "Сашо", "Сашка", "Алекс", "Алексей", "Алеко"],
98
+ latin: ["Aleksandar", "Aleksandra", "Aleksandrina", "Sasho", "Sashka", "Aleks", "Aleksey", "Aleko"],
99
+ month: 8, day: 30,
100
+ holiday: "Свети Александър",
101
+ holidayLatin: "Sveti Aleksandar",
102
+ tradition: "orthodox",
103
+ moveable: null,
104
+ },
105
+ {
106
+ name: "Илия",
107
+ variants: ["Илиян", "Илияна"],
108
+ latin: ["Iliya", "Iliyan", "Iliyana"],
109
+ month: 8, day: 2,
110
+ holiday: "Свети Илия (Илинден по стар стил)",
111
+ holidayLatin: "Sveti Iliya (Ilinden po star stil)",
112
+ tradition: "orthodox",
113
+ moveable: null,
114
+ },
115
+ {
116
+ name: "Герман",
117
+ variants: ["Германа"],
118
+ latin: ["German", "Germana"],
119
+ month: 8, day: 9,
120
+ holiday: "Свети Герман",
121
+ holidayLatin: "Sveti German",
122
+ tradition: "orthodox",
123
+ moveable: null,
124
+ },
125
+ {
126
+ name: "Евтихий",
127
+ variants: [],
128
+ latin: ["Evtihiy"],
129
+ month: 8, day: 24,
130
+ holiday: "Свети Евтихий",
131
+ holidayLatin: "Sveti Evtihiy",
132
+ tradition: "orthodox",
133
+ moveable: null,
134
+ },
135
+ {
136
+ name: "Лаврентий",
137
+ variants: ["Лаврен"],
138
+ latin: ["Lavrentiy", "Lavren"],
139
+ month: 8, day: 10,
140
+ holiday: "Свети Лаврентий",
141
+ holidayLatin: "Sveti Lavrentiy",
142
+ tradition: "orthodox",
143
+ moveable: null,
144
+ },
145
+ {
146
+ name: "Диомид",
147
+ variants: [],
148
+ latin: ["Diomid"],
149
+ month: 8, day: 16,
150
+ holiday: "Свети Диомид",
151
+ holidayLatin: "Sveti Diomid",
152
+ tradition: "orthodox",
153
+ moveable: null,
154
+ },
155
+ {
156
+ name: "Исак",
157
+ variants: [],
158
+ latin: ["Isak"],
159
+ month: 8, day: 3,
160
+ holiday: "Свети Исаак",
161
+ holidayLatin: "Sveti Isaak",
162
+ tradition: "orthodox",
163
+ moveable: null,
164
+ },
165
+ {
166
+ name: "Флора",
167
+ variants: ["Флорентина", "Лавър"],
168
+ latin: ["Flora", "Florentina", "Lavar"],
169
+ month: 8, day: 18,
170
+ holiday: "Свети Флор и Лавър",
171
+ holidayLatin: "Sveti Flor i Lavar",
172
+ tradition: "orthodox",
173
+ moveable: null,
174
+ },
175
+ ];