bodrumtaxi 1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +470 -0
  3. package/index.js +169 -0
  4. package/package.json +35 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Taximatic
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,470 @@
1
+ # bodrumtaxi
2
+
3
+ > A lightweight Node.js toolkit for **Bodrum taxi & transfer** information and **estimated** fare calculations across the Bodrum peninsula.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/bodrumtaxi.svg)](https://www.npmjs.com/package/bodrumtaxi)
6
+ [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
7
+ [![node](https://img.shields.io/node/v/bodrumtaxi.svg)](https://nodejs.org)
8
+
9
+ 🌐 **Website:** [bodrumtaxi.pages.dev](https://bodrumtaxi.pages.dev)
10
+
11
+ ---
12
+
13
+ ## Why this package?
14
+
15
+ Planning a trip to Bodrum, Türkiye? Whether you are landing at **Milas-Bodrum Airport (BJV)** and need a transfer to your hotel in Yalıkavak, building a travel app, or just curious how much a ride from Bodrum Center to Turgutreis might cost — `bodrumtaxi` gives you a tiny, dependency-free helper to:
16
+
17
+ - Look up basic information about Bodrum taxi & transfer services.
18
+ - Get the list of popular destinations across the peninsula.
19
+ - Compute a **rough fare estimate** between any two supported locations.
20
+ - Use it from code (CommonJS / ESM-interop) or directly from the command line.
21
+
22
+ The package is intentionally small (under 100 lines of logic, **zero dependencies**), so it loads instantly and is safe to embed anywhere — serverless functions, chatbots, travel widgets, CLI tools, or static-site build steps.
23
+
24
+ ---
25
+
26
+ ## Table of Contents
27
+
28
+ - [Features](#features)
29
+ - [Installation](#installation)
30
+ - [Quick Start](#quick-start)
31
+ - [API Reference](#api-reference)
32
+ - [`info()`](#info)
33
+ - [`services()`](#services)
34
+ - [`locations()`](#locations)
35
+ - [`transferPrice(from, to)`](#transferpricefrom-to)
36
+ - [Constants](#constants)
37
+ - [How pricing works](#how-pricing-works)
38
+ - [Supported locations](#supported-locations)
39
+ - [CLI usage](#cli-usage)
40
+ - [Examples](#examples)
41
+ - [Error handling](#error-handling)
42
+ - [About Bodrum](#about-bodrum)
43
+ - [Disclaimer](#disclaimer)
44
+ - [Roadmap](#roadmap)
45
+ - [Contributing](#contributing)
46
+ - [License](#license)
47
+
48
+ ---
49
+
50
+ ## Features
51
+
52
+ - ✅ **Zero dependencies** — installs in milliseconds, ships in ~3 KB.
53
+ - ✅ **Synchronous API** — every function returns a plain object/array, no promises required.
54
+ - ✅ **Diacritic-tolerant lookups** — `"yalıkavak"`, `"Yalikavak"`, and `"YALIKAVAK"` all match.
55
+ - ✅ **Bidirectional distance lookup** — `A → B` and `B → A` resolve from a single table entry.
56
+ - ✅ **CLI mode** — runnable with `node node_modules/bodrumtaxi` for a quick overview.
57
+ - ✅ **Transparent pricing** — base fare, per-km rate and currency are exposed as exported constants.
58
+ - ✅ **Node.js 14+** — works on every actively supported runtime.
59
+
60
+ ---
61
+
62
+ ## Installation
63
+
64
+ ```bash
65
+ npm install bodrumtaxi
66
+ ```
67
+
68
+ or with Yarn / pnpm:
69
+
70
+ ```bash
71
+ yarn add bodrumtaxi
72
+ pnpm add bodrumtaxi
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Quick Start
78
+
79
+ ```javascript
80
+ const bodrumtaxi = require('bodrumtaxi');
81
+
82
+ // 1. Basic service info
83
+ console.log(bodrumtaxi.info().website);
84
+ // → 'https://bodrumtaxi.pages.dev'
85
+
86
+ // 2. List services
87
+ console.log(bodrumtaxi.services());
88
+ // → [ 'Airport Transfer (Milas-Bodrum)', 'City Taxi', 'VIP Transfer', ... ]
89
+
90
+ // 3. Estimate a fare
91
+ const fare = bodrumtaxi.transferPrice('Milas-Bodrum Airport', 'Yalıkavak');
92
+ console.log(`${fare.distanceKm} km — ~${fare.estimatedPrice} ${fare.currency}`);
93
+ // → '65 km — ~1825 TRY'
94
+ ```
95
+
96
+ ---
97
+
98
+ ## API Reference
99
+
100
+ All functions are **synchronous** and return plain JavaScript values. There are no side effects and no network calls.
101
+
102
+ ### `info()`
103
+
104
+ Returns a snapshot of the service.
105
+
106
+ ```javascript
107
+ bodrumtaxi.info();
108
+ // {
109
+ // name: 'Bodrum Taxi',
110
+ // website: 'https://bodrumtaxi.pages.dev',
111
+ // region: 'Bodrum, Muğla, Türkiye',
112
+ // availability: '24/7',
113
+ // description: 'Bodrum peninsula taxi and transfer services: airport transfers, ...'
114
+ // }
115
+ ```
116
+
117
+ | Field | Type | Description |
118
+ | -------------- | -------- | ------------------------------------------------------ |
119
+ | `name` | `string` | Brand name. |
120
+ | `website` | `string` | Canonical URL of the service. |
121
+ | `region` | `string` | Operational region. |
122
+ | `availability` | `string` | Operating hours (always `'24/7'`). |
123
+ | `description` | `string` | One-sentence summary of the offering. |
124
+
125
+ ---
126
+
127
+ ### `services()`
128
+
129
+ Returns the list of service categories.
130
+
131
+ ```javascript
132
+ bodrumtaxi.services();
133
+ // [
134
+ // 'Airport Transfer (Milas-Bodrum)',
135
+ // 'City Taxi',
136
+ // 'VIP Transfer',
137
+ // 'Hotel Transfer',
138
+ // 'Boat / Marina Transfer',
139
+ // 'Intercity Transfer'
140
+ // ]
141
+ ```
142
+
143
+ **Returns:** `string[]` — six service categories, ordered from most-requested to least.
144
+
145
+ ---
146
+
147
+ ### `locations()`
148
+
149
+ Returns every location supported by the pricing engine.
150
+
151
+ ```javascript
152
+ bodrumtaxi.locations();
153
+ // [
154
+ // 'Milas-Bodrum Airport',
155
+ // 'Bodrum Center',
156
+ // 'Gümbet',
157
+ // 'Bitez',
158
+ // 'Ortakent',
159
+ // 'Yalıkavak',
160
+ // 'Türkbükü',
161
+ // 'Göltürkbükü',
162
+ // 'Turgutreis',
163
+ // 'Gündoğan',
164
+ // 'Akyarlar',
165
+ // 'Yalı'
166
+ // ]
167
+ ```
168
+
169
+ **Returns:** `string[]` — canonical names. You can pass *any* casing or any (de)diacriticised variant to `transferPrice` and it will still match.
170
+
171
+ ---
172
+
173
+ ### `transferPrice(from, to)`
174
+
175
+ Estimate the fare between two locations.
176
+
177
+ ```javascript
178
+ bodrumtaxi.transferPrice('Milas-Bodrum Airport', 'Yalıkavak');
179
+ // {
180
+ // from: 'Milas-Bodrum Airport',
181
+ // to: 'Yalıkavak',
182
+ // distanceKm: 65,
183
+ // estimatedPrice: 1825,
184
+ // currency: 'TRY',
185
+ // note: 'Estimated fare. For an exact quote visit https://bodrumtaxi.pages.dev'
186
+ // }
187
+ ```
188
+
189
+ **Parameters**
190
+
191
+ | Name | Type | Description |
192
+ | ------ | -------- | ------------------------------------------------ |
193
+ | `from` | `string` | Origin location name (case/diacritic insensitive). |
194
+ | `to` | `string` | Destination location name. |
195
+
196
+ **Returns** an object with:
197
+
198
+ | Field | Type | Description |
199
+ | ---------------- | -------- | ------------------------------------------------------------ |
200
+ | `from` | `string` | The origin you passed in (echoed back, untouched). |
201
+ | `to` | `string` | The destination you passed in. |
202
+ | `distanceKm` | `number` | Approximate road distance in kilometres. |
203
+ | `estimatedPrice` | `number` | `BASE_FARE + (distanceKm × PER_KM)` in TRY. |
204
+ | `currency` | `string` | Always `'TRY'` in v1. |
205
+ | `note` | `string` | Reminder that this is an estimate, plus a link to the site. |
206
+
207
+ **Failure mode** — when either name cannot be resolved, the function returns:
208
+
209
+ ```javascript
210
+ {
211
+ error: true,
212
+ message: 'Location not found: "Mars" → "Yalıkavak". Use locations() to list supported names.'
213
+ }
214
+ ```
215
+
216
+ > Calling `transferPrice('Bodrum Center', 'Bodrum Center')` returns a valid result with `distanceKm: 0` and `estimatedPrice: 200` (the base fare).
217
+
218
+ ---
219
+
220
+ ### Constants
221
+
222
+ For full transparency, the pricing constants and version are exported:
223
+
224
+ ```javascript
225
+ const { BASE_FARE, PER_KM, CURRENCY, VERSION } = require('bodrumtaxi');
226
+ console.log(BASE_FARE); // 200
227
+ console.log(PER_KM); // 25
228
+ console.log(CURRENCY); // 'TRY'
229
+ console.log(VERSION); // '1.0.0'
230
+ ```
231
+
232
+ ---
233
+
234
+ ## How pricing works
235
+
236
+ The fare formula is intentionally simple and easy to audit:
237
+
238
+ ```
239
+ estimatedPrice = BASE_FARE + (distanceKm × PER_KM)
240
+ ```
241
+
242
+ | Constant | Value | Meaning |
243
+ | ----------- | -------- | --------------------------------------------- |
244
+ | `BASE_FARE` | `200` | Pickup / start charge in TRY |
245
+ | `PER_KM` | `25` | Per-kilometre cost in TRY |
246
+ | `CURRENCY` | `'TRY'` | Turkish Lira |
247
+
248
+ Distances are stored in a hand-curated lookup table built from typical road routes across the Bodrum peninsula. Lookups are bidirectional — only one direction needs to be in the table for both `A → B` and `B → A` to resolve.
249
+
250
+ This is **not** a routing engine and does **not** factor in:
251
+
252
+ - Real-time traffic
253
+ - Time of day / night surcharge
254
+ - Vehicle class (sedan, minibus, VIP)
255
+ - Tolls or seasonal price changes
256
+ - Number of passengers or luggage
257
+
258
+ Treat the returned `estimatedPrice` as a rough order-of-magnitude figure, not a quote.
259
+
260
+ ---
261
+
262
+ ## Supported locations
263
+
264
+ Approximate road distances used by the engine:
265
+
266
+ | Route | Distance |
267
+ | -------------------------------------- | -------- |
268
+ | Milas-Bodrum Airport → Bodrum Center | 36 km |
269
+ | Milas-Bodrum Airport → Gümbet | 38 km |
270
+ | Milas-Bodrum Airport → Bitez | 40 km |
271
+ | Milas-Bodrum Airport → Ortakent | 42 km |
272
+ | Milas-Bodrum Airport → Yalı | 45 km |
273
+ | Milas-Bodrum Airport → Gündoğan | 48 km |
274
+ | Milas-Bodrum Airport → Türkbükü | 50 km |
275
+ | Milas-Bodrum Airport → Göltürkbükü | 52 km |
276
+ | Milas-Bodrum Airport → Turgutreis | 55 km |
277
+ | Milas-Bodrum Airport → Akyarlar | 60 km |
278
+ | Milas-Bodrum Airport → Yalıkavak | 65 km |
279
+ | Bodrum Center → Gümbet | 3 km |
280
+ | Bodrum Center → Bitez | 6 km |
281
+ | Bodrum Center → Ortakent | 10 km |
282
+ | Bodrum Center → Yalı | 12 km |
283
+ | Bodrum Center → Gündoğan | 14 km |
284
+ | Bodrum Center → Türkbükü | 16 km |
285
+ | Bodrum Center → Yalıkavak | 18 km |
286
+ | Bodrum Center → Göltürkbükü | 18 km |
287
+ | Bodrum Center → Turgutreis | 20 km |
288
+ | Bodrum Center → Akyarlar | 25 km |
289
+
290
+ Need a route that is not in the table? [Open an issue](https://bodrumtaxi.pages.dev) and we will add it in a minor release.
291
+
292
+ ---
293
+
294
+ ## CLI usage
295
+
296
+ After installing the package you can invoke it directly:
297
+
298
+ ```bash
299
+ node node_modules/bodrumtaxi
300
+ ```
301
+
302
+ You will see a friendly summary like:
303
+
304
+ ```
305
+ ===================================
306
+ bodrumtaxi v1.0.0
307
+ Bodrum Taxi & Transfer
308
+ ===================================
309
+ Website: https://bodrumtaxi.pages.dev
310
+
311
+ Services:
312
+ - Airport Transfer (Milas-Bodrum)
313
+ - City Taxi
314
+ - VIP Transfer
315
+ - Hotel Transfer
316
+ - Boat / Marina Transfer
317
+ - Intercity Transfer
318
+
319
+ Sample fare (Airport → Yalıkavak):
320
+ 65 km, ~1825 TRY
321
+
322
+ API: info(), services(), locations(), transferPrice(from, to)
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Examples
328
+
329
+ ### Build a tiny "fare of the day" widget
330
+
331
+ ```javascript
332
+ const { transferPrice, locations } = require('bodrumtaxi');
333
+
334
+ const all = locations();
335
+ const from = 'Milas-Bodrum Airport';
336
+ const to = all[Math.floor(Math.random() * all.length)];
337
+
338
+ const fare = transferPrice(from, to);
339
+ if (fare.error) {
340
+ console.error(fare.message);
341
+ } else {
342
+ console.log(`Today's pick: ${from} → ${to} ≈ ${fare.estimatedPrice} ${fare.currency}`);
343
+ }
344
+ ```
345
+
346
+ ### List every airport-departure fare, sorted
347
+
348
+ ```javascript
349
+ const { transferPrice, locations } = require('bodrumtaxi');
350
+
351
+ const fares = locations()
352
+ .filter(loc => loc !== 'Milas-Bodrum Airport')
353
+ .map(to => transferPrice('Milas-Bodrum Airport', to))
354
+ .filter(f => !f.error)
355
+ .sort((a, b) => a.estimatedPrice - b.estimatedPrice);
356
+
357
+ for (const f of fares) {
358
+ console.log(`${f.to.padEnd(20)} ${f.distanceKm.toString().padStart(3)} km ~${f.estimatedPrice} ${f.currency}`);
359
+ }
360
+ ```
361
+
362
+ ### Use it inside an Express endpoint
363
+
364
+ ```javascript
365
+ const express = require('express');
366
+ const { transferPrice } = require('bodrumtaxi');
367
+
368
+ const app = express();
369
+
370
+ app.get('/fare', (req, res) => {
371
+ const { from, to } = req.query;
372
+ const result = transferPrice(from, to);
373
+ if (result.error) return res.status(400).json(result);
374
+ return res.json(result);
375
+ });
376
+
377
+ app.listen(3000);
378
+ ```
379
+
380
+ ### Forgiving input (diacritics & casing)
381
+
382
+ ```javascript
383
+ const { transferPrice } = require('bodrumtaxi');
384
+
385
+ transferPrice('milas-bodrum airport', 'YALIKAVAK').distanceKm; // 65
386
+ transferPrice('Yalıkavak', 'Milas-Bodrum Airport').distanceKm; // 65 (reverse)
387
+ transferPrice(' Bodrum Center ', 'gumbet').distanceKm; // 3
388
+ ```
389
+
390
+ ---
391
+
392
+ ## Error handling
393
+
394
+ `transferPrice` never throws. On unrecognised input it returns an error-shaped object instead, so you can branch with a simple `if`:
395
+
396
+ ```javascript
397
+ const result = transferPrice('Atlantis', 'Bitez');
398
+ if (result.error) {
399
+ // Handle gracefully — show suggestions, log, fall back, etc.
400
+ console.warn(result.message);
401
+ } else {
402
+ // Happy path
403
+ renderQuote(result);
404
+ }
405
+ ```
406
+
407
+ This shape was chosen so the function can be used safely inside `Array.prototype.map` and other pipelines without try/catch noise.
408
+
409
+ ---
410
+
411
+ ## About Bodrum
412
+
413
+ [Bodrum](https://en.wikipedia.org/wiki/Bodrum) is a coastal town and district in Muğla Province on Türkiye's southwestern Aegean coast. It sits across from the Greek island of Kos and is known for its castle, marina, vibrant nightlife and the surrounding peninsula villages — Yalıkavak, Türkbükü, Bitez, Gümbet, Turgutreis and more — each with its own character.
414
+
415
+ Most international visitors arrive at **Milas-Bodrum Airport (IATA: BJV)**, located about 36 km north of Bodrum Center. From there, the most common onward transport is a **pre-booked taxi or transfer**, which is exactly the use case this package was built around.
416
+
417
+ ---
418
+
419
+ ## Disclaimer
420
+
421
+ This package is an **independent open-source utility**. The fare formula and distance table are best-effort approximations and **do not constitute a price quote**. Real-world pricing varies with:
422
+
423
+ - Vehicle type and capacity
424
+ - Time of day and seasonal demand
425
+ - Traffic and route choice
426
+ - Tolls, luggage handling and waiting time
427
+ - Local regulations and operator pricing
428
+
429
+ For an accurate, bookable quote please visit **[bodrumtaxi.pages.dev](https://bodrumtaxi.pages.dev)**.
430
+
431
+ ---
432
+
433
+ ## Roadmap
434
+
435
+ Possible future additions (no commitments):
436
+
437
+ - 🌍 Additional Bodrum peninsula villages and stops.
438
+ - 💱 Currency conversion helper (`EUR`, `USD`, `GBP`).
439
+ - 🌙 Night-tariff and seasonal multipliers.
440
+ - 🛣️ Distance lookup as a standalone export.
441
+ - 📦 ESM build alongside CommonJS.
442
+ - 🧪 Test suite with `vitest` once the API stabilises.
443
+
444
+ If any of these would be useful to you, please open a feature request on the [website](https://bodrumtaxi.pages.dev).
445
+
446
+ ---
447
+
448
+ ## Contributing
449
+
450
+ Bug reports, distance corrections and new locations are very welcome. Because the package is tiny, contributions usually consist of:
451
+
452
+ 1. Adding or correcting a row in the internal `_DISTANCES` table.
453
+ 2. Updating the documentation table above to match.
454
+ 3. Bumping the patch version.
455
+
456
+ Please keep the package **dependency-free** — that is a deliberate design constraint.
457
+
458
+ ---
459
+
460
+ ## License
461
+
462
+ [MIT](./LICENSE) © 2026 [Taximatic](https://bodrumtaxi.pages.dev)
463
+
464
+ ---
465
+
466
+ ## Links
467
+
468
+ - 🌐 Website: [bodrumtaxi.pages.dev](https://bodrumtaxi.pages.dev)
469
+ - 📦 npm: [npmjs.com/package/bodrumtaxi](https://www.npmjs.com/package/bodrumtaxi)
470
+ - 🧶 Yarn: [yarnpkg.com/package/bodrumtaxi](https://yarnpkg.com/package/bodrumtaxi)
package/index.js ADDED
@@ -0,0 +1,169 @@
1
+ // bodrumtaxi - Bodrum taxi & transfer module
2
+ // Information lookup and estimated transfer pricing for the Bodrum peninsula.
3
+ // https://bodrumtaxi.pages.dev
4
+
5
+ 'use strict';
6
+
7
+ const SITE = 'https://bodrumtaxi.pages.dev';
8
+ const VERSION = '1.0.0';
9
+
10
+ // ----- Constants -----
11
+
12
+ const BASE_FARE = 200; // TRY
13
+ const PER_KM = 25; // TRY per km
14
+ const CURRENCY = 'TRY';
15
+
16
+ // ----- Public: information -----
17
+
18
+ function info() {
19
+ return {
20
+ name: 'Bodrum Taxi',
21
+ website: SITE,
22
+ region: 'Bodrum, Muğla, Türkiye',
23
+ availability: '24/7',
24
+ description:
25
+ 'Bodrum peninsula taxi and transfer services: airport transfers, ' +
26
+ 'city rides, hotel pickups, marina transfers and VIP transport.'
27
+ };
28
+ }
29
+
30
+ function services() {
31
+ return [
32
+ 'Airport Transfer (Milas-Bodrum)',
33
+ 'City Taxi',
34
+ 'VIP Transfer',
35
+ 'Hotel Transfer',
36
+ 'Boat / Marina Transfer',
37
+ 'Intercity Transfer'
38
+ ];
39
+ }
40
+
41
+ function locations() {
42
+ return [
43
+ 'Milas-Bodrum Airport',
44
+ 'Bodrum Center',
45
+ 'Gümbet',
46
+ 'Bitez',
47
+ 'Ortakent',
48
+ 'Yalıkavak',
49
+ 'Türkbükü',
50
+ 'Göltürkbükü',
51
+ 'Turgutreis',
52
+ 'Gündoğan',
53
+ 'Akyarlar',
54
+ 'Yalı'
55
+ ];
56
+ }
57
+
58
+ // ----- Internal: location matching -----
59
+
60
+ function _normalize(s) {
61
+ if (typeof s !== 'string') return '';
62
+ return s
63
+ .toLowerCase()
64
+ .trim()
65
+ .replace(/ı/g, 'i')
66
+ .replace(/ş/g, 's')
67
+ .replace(/ğ/g, 'g')
68
+ .replace(/ü/g, 'u')
69
+ .replace(/ö/g, 'o')
70
+ .replace(/ç/g, 'c')
71
+ .replace(/[^a-z0-9]/g, '');
72
+ }
73
+
74
+ // Distances in km. Keys: normalized "from|to". Lookups try both directions.
75
+ const _DISTANCES = {
76
+ // From Milas-Bodrum Airport
77
+ 'milasbodrumairport|bodrumcenter': 36,
78
+ 'milasbodrumairport|gumbet': 38,
79
+ 'milasbodrumairport|bitez': 40,
80
+ 'milasbodrumairport|ortakent': 42,
81
+ 'milasbodrumairport|yalikavak': 65,
82
+ 'milasbodrumairport|turkbuku': 50,
83
+ 'milasbodrumairport|golturkbuku': 52,
84
+ 'milasbodrumairport|turgutreis': 55,
85
+ 'milasbodrumairport|gundogan': 48,
86
+ 'milasbodrumairport|akyarlar': 60,
87
+ 'milasbodrumairport|yali': 45,
88
+ // From Bodrum Center
89
+ 'bodrumcenter|gumbet': 3,
90
+ 'bodrumcenter|bitez': 6,
91
+ 'bodrumcenter|ortakent': 10,
92
+ 'bodrumcenter|yalikavak': 18,
93
+ 'bodrumcenter|turkbuku': 16,
94
+ 'bodrumcenter|golturkbuku': 18,
95
+ 'bodrumcenter|turgutreis': 20,
96
+ 'bodrumcenter|gundogan': 14,
97
+ 'bodrumcenter|akyarlar': 25,
98
+ 'bodrumcenter|yali': 12
99
+ };
100
+
101
+ function _distanceBetween(a, b) {
102
+ const na = _normalize(a);
103
+ const nb = _normalize(b);
104
+ if (!na || !nb) return null;
105
+ if (na === nb) return 0;
106
+ return _DISTANCES[na + '|' + nb] ?? _DISTANCES[nb + '|' + na] ?? null;
107
+ }
108
+
109
+ // ----- Public: pricing -----
110
+
111
+ /**
112
+ * Estimate the transfer price between two Bodrum locations.
113
+ *
114
+ * @param {string} from - origin location name
115
+ * @param {string} to - destination location name
116
+ * @returns {object} a price object on success, or `{ error: true, message }` on failure.
117
+ */
118
+ function transferPrice(from, to) {
119
+ const km = _distanceBetween(from, to);
120
+ if (km === null) {
121
+ return {
122
+ error: true,
123
+ message:
124
+ 'Location not found: "' + from + '" → "' + to +
125
+ '". Use locations() to list supported names.'
126
+ };
127
+ }
128
+ return {
129
+ from: from,
130
+ to: to,
131
+ distanceKm: km,
132
+ estimatedPrice: BASE_FARE + (km * PER_KM),
133
+ currency: CURRENCY,
134
+ note: 'Estimated fare. For an exact quote visit ' + SITE
135
+ };
136
+ }
137
+
138
+ // ----- Exports -----
139
+
140
+ module.exports = {
141
+ info,
142
+ services,
143
+ locations,
144
+ transferPrice,
145
+ // pricing constants exposed for transparency
146
+ BASE_FARE,
147
+ PER_KM,
148
+ CURRENCY,
149
+ VERSION
150
+ };
151
+
152
+ // ----- CLI mode -----
153
+
154
+ if (require.main === module) {
155
+ console.log('===================================');
156
+ console.log(' bodrumtaxi v' + VERSION);
157
+ console.log(' Bodrum Taxi & Transfer');
158
+ console.log('===================================');
159
+ console.log('Website: ' + SITE);
160
+ console.log('');
161
+ console.log('Services:');
162
+ services().forEach(function (s) { console.log(' - ' + s); });
163
+ console.log('');
164
+ console.log('Sample fare (Airport → Yalıkavak):');
165
+ const sample = transferPrice('Milas-Bodrum Airport', 'Yalıkavak');
166
+ console.log(' ' + sample.distanceKm + ' km, ~' + sample.estimatedPrice + ' ' + sample.currency);
167
+ console.log('');
168
+ console.log('API: info(), services(), locations(), transferPrice(from, to)');
169
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "bodrumtaxi",
3
+ "version": "1.0.0",
4
+ "description": "Bodrum taxi & transfer toolkit — service info, supported locations, and estimated transfer pricing for the Bodrum peninsula.",
5
+ "main": "index.js",
6
+ "files": [
7
+ "index.js",
8
+ "README.md",
9
+ "LICENSE"
10
+ ],
11
+ "scripts": {
12
+ "start": "node index.js",
13
+ "test": "node -e \"const m=require('./index.js'); console.log(m.info()); console.log(m.transferPrice('Milas-Bodrum Airport','Yalıkavak'));\""
14
+ },
15
+ "keywords": [
16
+ "bodrum",
17
+ "taxi",
18
+ "transfer",
19
+ "airport",
20
+ "milas",
21
+ "yalikavak",
22
+ "turgutreis",
23
+ "vip",
24
+ "shuttle",
25
+ "fare",
26
+ "estimate",
27
+ "turkey"
28
+ ],
29
+ "author": "Taximatic",
30
+ "license": "MIT",
31
+ "homepage": "https://bodrumtaxi.pages.dev",
32
+ "engines": {
33
+ "node": ">=14"
34
+ }
35
+ }