npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@react-map-input/data-tr

v0.1.0

Published

Türkiye province (il) and district (ilçe) geopack for react-map-input.

Readme

@react-map-input/data-tr

Türkiye geopack for react-map-input81 provinces (il) and 973 districts (ilçe).

npm install react-map-input @react-map-input/data-tr
import { GeoInput } from 'react-map-input';
import { turkey } from '@react-map-input/data-tr';

<GeoInput pack={turkey} name="serviceAreas" />;

What is in it

Geometry is pre-projected at build time into one shared coordinate space (Albers conic equal-area, standard parallels 37.5°/40.5°), emitted as ready-to-render SVG path data. Nothing is projected in the browser.

| File | Size | |---|---| | regions.js — all 81 provinces | 149 KB raw · 59 KB gzipped | | subregions/TR-xx.js — one province's districts | 2–19 KB raw, median 5.6 KB (~2 KB gzipped) | | all districts together | 527 KB — never loaded at once |

Districts load lazily per province through a generated static import map, so bundlers code-split them automatically: opening İstanbul fetches 4 KB gzipped, not the whole country.

Geographic regions

The pack also carries the seven coğrafi bölgeler as turkey.groups, dissolved from the same topology as the provinces so their borders follow province lines exactly:

| Region | English | Provinces | |---|---|---| | Akdeniz | Mediterranean | 8 | | Doğu Anadolu | Eastern Anatolia | 14 | | Ege | Aegean | 8 | | Güneydoğu Anadolu | Southeastern Anatolia | 9 | | İç Anadolu | Central Anatolia | 13 | | Karadeniz | Black Sea | 18 | | Marmara | Marmara | 11 |

Every province belongs to exactly one region, asserted by the build.

They are drawn as the outermost border level and are never selectable.

Region assignment comes from a reference table, not from provinces.json

The supplied region labels proved wrong for three provinces, so the assignment is taken from source/region-reference.json — the 1941 Geography Congress classification, checked in as data. The build logs every province where the two disagree, and fails if any province is missing from the table or listed in two regions. The supplied files are never edited.

| Province | provinces.json says | Reference | Why the source is wrong | |---|---|---|---| | Bartın | North Sea | Black Sea | Disagreed with its own Turkish label and the other 17 Karadeniz provinces, producing a phantom eighth region. | | Çankırı | Marmara | İç Anadolu | ~400 km from the Sea of Marmara; borders only İç Anadolu and Karadeniz provinces. | | Hakkari | Güneydoğu Anadolu | Doğu Anadolu | Doğu Anadolu in the standard classification. |

A wrong region label is not a geometry error — it renders perfectly, just in the wrong colour — so it needs its own check. An earlier heuristic asserted group cohesion (every region must have a group-mate among its five nearest neighbours); it caught Çankırı but not Hakkari, which borders Şırnak, genuinely Güneydoğu, so the wrong label still had a same-region neighbour. Only an explicit reference table catches that class of error. Cohesion remains on as a second, independent check, with an allowIsolatedRegions escape hatch for genuinely detached members.

Codes

Provinces use ISO 3166-2 (TR-34), districts are always region-scoped (TR-34-kadikoy).

Region-scoping is not cosmetic: 25 district names are reused across provinces and Merkez appears 51 times, so a district can only be identified together with its province.

Attributes

turkey.regions[0].meta;
// { plateCode, population, areaKm2, altitudeM, phoneAreaCodes,
//   isCoastal, isMetropolitan, region: { tr, en } }

Useful with regionsWhere for bulk selection — 7 geographic regions, 28 coastal provinces, 30 metropolitan municipalities.

Source data

source/ holds the build-time inputs and is not published. The two upstream files contain no geometry — they are the identity and validation layer that OpenStreetMap's polygons are matched against. See source/README.md.

Rebuilding

npm run build:data   # fetches ~16 MB of geodata on first run, then caches

Match, simplify, dissolve, project, validate, emit — see CONTRIBUTING.md for what each step does.

The build fails rather than guessing: it must reproduce the canonical source exactly — 81 provinces, 973 districts, every per-province count matching stats.districtCount, and every district matched to exactly one polygon. Adjust simplification with GEOPACK_SIMPLIFY=4%.

Licence

Geodata is ODbL 1.0 and requires attribution — see LICENSE and ATTRIBUTION.md. The react-map-input component library is MIT and contains no geodata, so share-alike does not reach your application code.